Description Usage Arguments Details Value Note Author(s) See Also Examples
Create a matrix with taxa as rows and occurrences or samples as columns
1 2 3 4 5 6 7 8 9 | create.matrix(
x,
tax.name="genus",
locality="locality",
time.col=NULL,
time=NULL,
abund=FALSE,
abund.col="abundance"
)
|
x |
a table arranged in columnar format, with at least one column indicating name of taxa and another giving location or sample |
tax.name |
the name or number of the column giving the taxonomic names to be used (the rows of the matrix to be created) |
locality |
the name or number of the column giving the locations of the samples (the columns of the matrix to be created) |
time.col |
what is the column name or number containing the time periods; if left null, filtering for time willbe ignored |
time |
what time periods to keep for the matrix; if left null, filtering for time willbe ignored |
abund |
whether to record abundances of taxa; if left FALSE, a binary (presence/absence) matrix is created |
abund.col |
column name or number containing abundance values |
This is a helper function to convert large lists of data into matrices of
species (rows) and locations (columns). The parameters can be adjusted to
create either a binary (presence/absence) or abundance matrix. The setup of
the table is largely flexible; simply input the column names or numbers
containing the pertinent information. To filter data according to time, both
the time column and the time period must be specified. For abundance, the
default title for the abundance column is simply "abundance"; the function
will not work if you have chosen to include abundances (abund = TRUE
but the name of the abundance column is incorrect.
A matrix of taxa (rows) by localities (columns).
At present, the function will ignore rows where the taxon name is NA
, NULL
, ''
(empty character value) or ' '
(single space), as these labels typically represent an unknown taxa, which would be inappropriate to include in most analyses.
Matthew Vavrek
1 2 3 4 5 6 7 | #converting the fdata.list dataset into a matrix of species (rows)
#by samples (columns) with abundance data
data(fdata.list)
create.matrix(fdata.list, tax.name = "species", abund=TRUE)
#same data set, but now for an occurrence matrix
create.matrix(fdata.list, tax.name = "species", locality = "locality")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.