View source: R/phyloframe.to.matrix.R
phyloframe.to.matrix | R Documentation |
Converts input data frame for gpf to matrix for faster indexing
phyloframe.to.matrix(DF, mat.data = "N", empty.val = 0)
DF |
data frame containing, at the minimum, columns |
mat.data |
Character string. Column of |
empty.val |
Value for empty Species x Sample pairs. Default is 0. |
library(phylofactor)
m=10 #number of species
n=15 #number of samples
d=100 #number of data points
DF <- data.frame('Species'=sample(letters[1:m],d,replace=TRUE),
'Sample'=sample(1:n,d,replace=TRUE),
'Abundance'=rpois(d,2))
M <- phyloframe.to.matrix(DF,mat.data='Abundance',empty.val=0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.