cross_cor: Pairwise correlations

Description Usage Arguments Details Value Examples

View source: R/cross_cor.R

Description

Compute pairwise correlations within a list of vector.

Usage

1
cross_cor(L, remove = TRUE, .names = names(L), ...)

Arguments

L

the list of all vector to be compared.

remove

logical. If TRUE (default), shared zeros are removed.

.names

character.

...

arguments to be passed to cor such as method (see details).

Details

For method: one of "pearson" (default), "kendall", or "spearman".

Value

A similarity matrix of class dist with all correlation between vectors.

Examples

1
2
3
4
5
6
7
8
df <- data.frame(Clade = letters[1:4],
                 v = c(3, 0, 0, 3),
                 w = c(4, 5, 7, 0),
                 x = c(8, 5, 5, 0),
                 y = c(1, 8, 0, 0),
                 z = c(3, 5, 2, 2))
L <- mat2list(df2mat(df))
cross_cor(L, remove = TRUE, method = "spearman")

abichat/correlationtree documentation built on March 11, 2020, 3:55 p.m.