template_similarity | R Documentation |
Compute similarity between each density map in a source_tab
with a matching ("template") density map in ref_tab
.
template_similarity(
ref_tab,
source_tab,
match_on,
permute_on = NULL,
refvar = "density",
sourcevar = "density",
method = c("spearman", "pearson", "fisherz", "cosine", "l1", "jaccard", "dcov"),
permutations = 10,
...
)
ref_tab |
A data frame or tibble containing reference density maps. |
source_tab |
A data frame or tibble containing source density maps. |
match_on |
A character string representing the variable used to match density maps between |
permute_on |
A character string representing the variable used to stratify permutations (default is NULL). |
refvar |
A character string representing the name of the variable containing density maps in the reference table (default is "density"). |
sourcevar |
A character string representing the name of the variable containing density maps in the source table (default is "density"). |
method |
A character string specifying the similarity method to use. Possible values are "spearman", "pearson", "fisherz", "cosine", "l1", "jaccard", and "dcov" (default is "spearman"). |
permutations |
A numeric value specifying the number of permutations for the baseline map (default is 10). |
... |
Extra arguments to pass to the 'similarity' function. |
The run_similarity_analysis
function is the core of the similarity calculations in this function. It checks for matching indices between reference and source tables, filters out non-matching elements, and splits matching indices based on the permute_on
variable if specified. The similarity is then calculated between matched density maps using the specified method and, if applicable, permutations for the baseline map. The output includes the source table along with additional columns for the similarity scores and permutation results.
A data frame or tibble containing the source table and additional columns with the similarity scores and permutation results.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.