I would like to use the "create.matrix" function to create a matrix of taxa, localities, time and abundance.
In the function, time is specified by the arguments "time.col" (= column name or number containing the time periods) and "time" (= which time periods to keep for the matrix). In my data table, time is specified as a calendar date (d.m.y: e.g. 31.12.2022).
How should time ("time periods") be specified or formatted in the data table to be used by the create.matrix function?
How should time periods be specified in the "time" argument?
Edit (21/4/2024): Reproducible example:
A part of the data (dat.txt, tab delimited).
I want to create a species by (locality by date) matrix. Some localities were sampled only once, some several times. As "time period" in the argument "time" I want to use the date of sampling (column "date" in the dataset), but I do not know how to specify it in the code below ("????"):
Function:
df <- create.matrix(dat, tax.name = "taxon_abbrev",
locality = "locality_ID",
time.col="date",
time="????",
abund.col = "num",
abund = TRUE)