View source: R/pp_similarity.R
| pp_similarity | R Documentation |
Calculate similarity between portfolios.
pp_similarity(D, id = NULL, method = "all", return_all = TRUE)
D |
Data frame in a tidy format with the following columns: "Country", "Sector", "Year", "Instrument", "Target" and "covered". "covered" is a binary identificator of whether the portfolio space is covered by policy intervention (1) or not (0). The remaining columns identify the case. Notice that "Year" is a numeric value, while the remaining 4 case identifiers are factors. |
id |
A list with up to two elements, namely "Country", and "Year" indicating the specific identification characteristics of the portfolio(s) that must be processed. Defaults to NULL to process all portfolios. |
method |
A character vector containing the indices of similarity requested. Defaults to "all". The implemented indices of binary similarity are "Jaccard", "Hamming" (Hamming distance), "Dice" (Sorensen & Dice), "Overlap" (Szymkiewicz and Simpson) and "Rand" (or Simple Matching Coefficient). |
return_all |
Logical indicating whether all possible combinations (countries and years of origin and destination) must be returned or only when they are different. Defaults to TRUE. |
A tidy dataset containing the portfolio identificators (Country, Sector and Year) plus the similarity measures and their values.
## Not run:
data(P.education)
pp_similarity(P.education, id = list(Year = 2025))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.