Compute the functional diversity indices and community weighted means.
Source:R/fw_fdcompute.R
fw_fdcompute.Rd
Compute 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
list
A list from thefw_fetchdata
function is the only data type accepted.- sitesdata
dataframe
Dataframe with sites for which functional diversity and community weighted means indices will be computed for.- species
string
The species column in the sitesdata.- sites
string
The 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
integer
The distance used to cluster points as sites. The default is 1000.- abund
string
Column with abundance data. If not provided, then only functional richness can be computed.- FD
logical
To indicate whether to compute functional richness or community weighted means. The default is TRUE.- dummy
logical
To 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)
} # }