correlation_tree: Correlation tree

Description Usage Arguments Details Value Examples

View source: R/correlation_tree.R

Description

Compute the correlation tree from an abundance table.

Usage

1
2
3
4
5
6
7
8
9
correlation_tree(
  table,
  col = 1,
  matrix = FALSE,
  remove = TRUE,
  fill = FALSE,
  transformation = "1-x",
  ...
)

Arguments

table

a dataframe or a matrix.

col

integer giving the column to be passed as row names.

matrix

logical. Is table a matrix? Default to FALSE.

remove

logical. If TRUE (default), shared zeros between species are removed for the computation of the pairwise correlation coefficients.

fill

logical. If TRUE, NA are set to 0. Default to FALSE.

transformation

function or character. Transformation to apply to each element of the matrix.

...

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

Details

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

Value

correlation_tree returns a "phylo" object.

Examples

1
2
3
4
5
6
7
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))
plot(correlation_tree(df, method = "spearman"))

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