template_similarity: template_similarity

View source: R/similarity.R

template_similarityR Documentation

template_similarity

Description

Compute similarity between each density map in a source_tab with a matching ("template") density map in ref_tab.

Usage

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,
  ...
)

Arguments

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 ref_tab and source_tab.

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.

Details

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.

Value

A data frame or tibble containing the source table and additional columns with the similarity scores and permutation results.


bbuchsbaum/eyesim documentation built on May 9, 2023, 3:29 a.m.