Description Usage Arguments Value Author(s) References Examples
mapTraits
add species trait values to species distribution in geographic space.
1 |
x |
A community data object - a vector (with names matching trait data) or a data.frame or matrix (with column names matching names in trait data) |
trait |
A data.frame of species traits with a column of species names matching species names in the community data, and another column with the trait values. |
FUN |
The function used to aggregate species trait values in geographic space.
By default, if |
... |
Further arguments passed to or from other methods. |
|
A data frame of species traits by site |
Barnabas H. Daru darunabas@gmail.com
Daru2015ddibioregion
1 2 3 4 5 6 7 8 9 | require(data.table)
fdir <- system.file("NGAplants", package="bioregion")
files <- file.path(fdir, dir(fdir))
dat <- data.frame(raster2comm(files))
dd <- data.frame(table(dat$species))
names(dd) <- c("species", "range")
trait_range <- dd$range
names(trait_range) <- dd$species
gg <- mapTraits(dat, trait = trait_range, FUN = sd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.