cosine_sim_func: Calculate the pairwise similarity between rows of input...

Description Usage Arguments Value Examples

View source: R/math-funcs.R

Description

Calculate the pairwise similarity between rows of input matrix

Usage

1
cosine_sim_func(input_mat)

Arguments

input_mat

Input matrix.

Value

Square matrix of the similarity. Diagonal values should be 1.

Examples

1
2
m <- matrix(1:8, ncol = 2) # a 4x2 matrix
cosine_sim_func(m) # a 4x4 similarity matrix

covidclinical/Phase2.1TDAPseudotimeRPackage documentation built on Sept. 27, 2020, 12:03 a.m.