df2mat: Dataframe to matrix

Description Usage Arguments Details Value Examples

View source: R/df2mat.R

Description

Convert an abundance dataframe to a named matrix.

Usage

1
df2mat(df, col = 1)

Arguments

df

a data frame.

col

integer giving the column to be passed as row names.

Details

Use col = 0 if there are already row names (or use as.matrix(df) directly).

Value

df2mat returns a named matrix.

Examples

1
2
df <- data.frame(Clade = letters[1:4], S1 = 1:4, S2 = 7:8)
df2mat(df)

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