Compute the functional diversity indices and community weighted means.
Source:R/fw_fdcompute.R
fw_fdcompute.RdCompute the functional diversity indices and community weighted means.
Usage
fw_fdcompute(
fwdata,
sitesdata,
species,
sites = NULL,
dist = 1000,
abund = NULL,
FD = TRUE,
dummy = TRUE
)Arguments
- fwdata
listA list from thefw_fetchdatafunction is the only data type accepted.- sitesdata
dataframeDataframe with sites for which functional diversity and community weighted means indices will be computed for.- species
stringThe species column in the sitesdata.- sites
stringThe sites column in the sitesdata. If the sites are not provided by the geometry column, then sites can be auto generated by clustering closely separated records into sites.- dist
integerThe distance used to cluster points as sites. The default is 1000.- abund
stringColumn with abundance data. If not provided, then only functional richness can be computed.- FD
logicalTo indicate whether to compute functional richness or community weighted means. The default is TRUE.- dummy
logicalTo form fuzzy code for the categorical traits. Default is TRUE.
Examples
if (FALSE) { # \dontrun{
set.seed(1135)
data('speciesdata')
speciesdata$abundance <- rnorm(n = nrow(speciesdata), 4.3, 1.2)
spgeo1 <- speciesdata |>
sf::st_as_sf(coords = c('decimalLongitude', 'decimalLatitude'), crs = sf::st_crs(4326))
sptraits <- fw_fetchdata(data = speciesdata,
ecoparams = c('rheophily habitat', 'spawning habitat',
'feeding diet adult'),
taxonomic_column = 'scientificName',
organismgroup = 'fi')
#functional richness
testdata5 <- fw_fdcompute(fwdata = sptraits,
sitesdata = speciesdata,
sites = 'waterBody',
species = 'scientificName',
FD = TRUE)
} # }