similarity_matrix: Similarity Matrix

Description Usage Arguments Value Examples

View source: R/functions.R

Description

This function receives a matrix where each row is a binary vector (e.g. symptoms' presence vector) and returns the corresponding NxN similarity matrix (pair-wise similarities) using the Adjusted Hubert-Arabie RAND index (ARI).

Usage

1
2
3
4
5
6
7
similarity_matrix(
  mat,
  concords = vecs2concords(mat),
  simil_measure = "ARI",
  reactive_dom = NULL,
  incProg_amount = 1
)

Arguments

mat

matrix

concords

list of concordance matrices (defaults to vecs2concords(mat)) to be compared.

simil_measure

string value, similarity function used, can be either 'ARI' (default) or 'Euclidean'.

reactive_dom

reactive domain in case used in a shiny app (will be used by incProgress()).

inProg_amount

real number in [0,1], the amount of status bar to fill up (default is 1), in case used in a shiny app (will be used by incProgress()).

Value

the corresponding NxN similarity matrix (pair-wise similarities) using the Adjusted Hubert-Arabie RAND index (ARI).

Examples

1
2
mat <- matrix(sample(c(1,0), 16, replace=TRUE), 3, 3)
similarity_matrix(mat)

oricel/concordNets documentation built on April 9, 2020, 3:45 a.m.