This function is to make the IDs, frequence, and abundnce in metacommunities consistent among different elements.
metaset(comm = NULL, meta.group = NULL, meta.com = NULL,
meta.frequency = NULL, meta.ab = NULL, tree = NULL)Output is a list object. comm=comm,meta.group=meta.group,meta.com=meta.com,meta.frequency=meta.frequency,meta.ab=meta.ab,meta.spool=meta.spool,comms=comms
community data table after matching IDs.
talbe showing metacommunity of each sample, after matchin IDs.
a list object showing each metacommunity data.
table showing observed frequency of each taxon in each metacommunity.
table showing abundances of each taxon in each metacommunity.
a list object showing detected taxon IDs in each metacommunity.
a list object splitting the observed community data table to different metacommunities.
matrix or data.frame, community data, each row is a sample or site, each colname is a taxon (a species or OTU or ASV), thus rownames should be sample IDs, colnames should be taxa IDs.
matrix or data.frame, a one-column (n x 1) matrix indicating which metacommunity each sample belongs to. Rownames are sample IDs. The first column is metacommunity names. Such that different samples can belong to different metacommunities. If input a n x m matrix, only the first column is used. NULL means all samples belong to the same metacommunity. Default is NULL, means all samples from the same metacommunity.
a list object, each element is a matrix or data.frame to define abundance (or relative abundance) of taxa in a metacommunity (regional pool). The element names indicate metacommunity names, which should be consistent with the metacommunity names defined in meta.group. If there is only one metacommunity, meta.com can be a matrix or data.frame to define taxa abundance (or relative abundance) in the metacommunity. Default is NULL, means to calculate metacommunity structure from comm according to metacommunities defined in meta.group.
a list object, each element is a matrix or data.frame to define abundance (or relative abundance) of taxa in a metacommunity (regional pool). The element names indicate metacommunity names, which should be consistent with the metacommunity names defined in meta.group. If there is only one metacommunity, meta.com can be a matrix or data.frame to define taxa abundance (or relative abundance) in the metacommunity. Default is NULL, means to calculate metacommunity structure from comm according to metacommunities defined in meta.group, or calculate from meta.com.
matrix or data.frame, each column represents a taxon, each row represents a metacommunity (regional pool), to define the aubndance (or relative abundance) of each taxon in each metacommunity. The rownames indicate metacommunity names, which should be the same as the metacommunity names in meta.group. Default setting is NULL, means to calculate meta.ab as average relative abundance of each taxon in comm across the samples within each metacommunity defined by meta.group, or calculate from meta.com.
phylogenetic tree, an object of class "phylo".
Daliang Ning
This is a handy tool for taxa.binphy.big.cm and other .cm (multiple metacommunities) functions.
# not yet
library(iCAMP)
data("example.data")
comm=example.data$comm
# in this example, 10 samples from one metacommunity,
# the other 10 samples from another metacommunity.
meta.group=data.frame(meta.com=c(rep("meta1",10),rep("meta2",10)))
rownames(meta.group)=rownames(comm)
metas=metaset(comm=comm,meta.group=meta.group)
metas$meta.spool
Run the code above in your browser using DataLab