splist2presabs {fuzzySim} | R Documentation |
This function takes a locality+species dataset in long (stacked) format, i.e., a matrix or data frame containing localities in one column and their recorded species in another column, and converts them to a presence-absence table (wide format) suitable for mapping and for computing distributional similarities (see e.g. simMat
). Try out the Examples below for an illustration).
splist2presabs(data, sites.col, sp.col, keep.n = FALSE)
data |
a matrix or data frame with localities in one column and species in another column. Type |
sites.col |
the name or index number of the column containing the localities in |
sp.col |
the name or index number of the column containing the species names or codes in |
keep.n |
logical value indicating whether to get in the resulting table the number of times each species appears in each locality; if |
A data frame containing the localities in the first column and then one column per species indicating their presence (or their number of records if keep.n = TRUE)
and absence. Type data(rotif.env);
head(rotif.env[,18:47])
for an example.
A. Marcia Barbosa
data(rotifers) head(rotifers) rotifers.presabs <- splist2presabs(rotifers, sites.col = "TDWG4", sp.col = "species", keep.n = FALSE) head(rotifers.presabs)