date_mat {algaeClassify} | R Documentation |
Transform a phytoplankton timeseries into a matrix of abundances for ordination
Description
Transform a phytoplankton timeseries into a matrix of abundances for ordination
Usage
date_mat(
phyto.df,
abundance.var = "biovol_um3_ml",
summary.type = "abundance",
taxa.name = "phyto_name",
date.name = "date_dd_mm_yy",
format = "%d-%m-%y",
time.agg = c("day", "month", "year", "monthyear"),
fun = mean_naomit
)
Arguments
phyto.df |
Name of data.frame object |
abundance.var |
Character string: field containing abundance data. Can be NA if the dataset only contains a species list for each sampling date. |
summary.type |
'abundance' for a matrix of aggregated abundance,'presence.absence' for 1 (present) and 0 (absent). |
taxa.name |
Character string: field containing taxonomic identifiers. |
date.name |
Character string: field containing date. |
format |
Character string: POSIX format string for formatting date column. |
time.agg |
Character string: time interval for aggregating abundance. default is day. |
fun |
function for aggregation. default is mean, excluding NA's. |
Value
A matrix of phytoplankton abundance, with taxa in rows and time in columns. If time.agg = 'monthyear', returns a 3dimensional matrix (taxa,month,year). If abundance.var = NA, matrix cells will be 1 for present, 0 for absent
Examples
data(lakegeneva)
#example dataset with 50 rows
geneva.mat1<-date_mat(lakegeneva,time.agg='month',summary.type='presence.absence')
geneva.mat2<-date_mat(lakegeneva,time.agg='month',summary.type='abundance')
geneva.mat1
geneva.mat2