create.matrix: Creating species locality matrices

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Create a matrix with taxa as rows and occurrences or samples as columns

Usage

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"
)

Arguments

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

Details

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.

Value

A matrix of taxa (rows) by localities (columns).

Note

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.

Author(s)

Matthew Vavrek

See Also

create.lats

Examples

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")

fossil documentation built on March 23, 2020, 5:06 p.m.