initSpParams.Rd
Creates an empty plant parameter table for medfate, populating taxonomic information if desired.
initSpParams(
sp_names,
SpParamsDefinition,
accepted_names = NULL,
fill_taxonomy = TRUE,
complete_rows = TRUE,
sort = TRUE,
verbose = FALSE
)
Vector of plant names, either taxon names or arbitrary species group names
Data frame of species parameter definition from package medfate
Vector of accepted taxon names of the same length of `sp_names`
Boolean flag to indicate that taxonomic information should be filled (retrieved from GBIF using package 'taxize')
Boolean flag to indicate that extra rows should be added for cited species/genera (if `fill_taxonomy = TRUE`)
Boolean flag to force sorting in ascending order by `Name`
A boolean flag to indicate extra console output
A data frame with empty species parameter values suitable for medfate simulations
Taxonomic information is retrieved using functions in package taxize and GBIF as data source.
if (FALSE) {
# Load species parameter definition from medfate
data(SpParamsDefinition)
# Simple example with two species
sp_names <- c("Salvia rosmarinifolia", "Pinus contorta")
initSpParams(sp_names, SpParamsDefinition)
# Simple example with three species using synonyms and subspecies
sp_names <- c("Rosmarinus officinalis", "Pinus contorta", "Quercus ilex subsp. ilex")
accepted_names <- c("Salvia rosmarinifolia", "Pinus contorta", "Quercus ilex subsp. ilex")
initSpParams(sp_names, SpParamsDefinition, accepted_names)
# Initialisation with Spanish NFI species mapping
data(NFI_SP_mapping)
# Remove species that are not mapped
NFI_SP_mapping_red <- NFI_SP_mapping[!is.na(NFI_SP_mapping$acceptedName),]
# Names in SpParams will be the original NFI names but accepted names
# will be used for parameter estimation
SpParams <- initSpParams(sp_names = NFI_SP_mapping_red$NFIName[1:20],
SpParamsDefinition = SpParamsDefinition,
accepted_names = NFI_SP_mapping_red$acceptedName[1:20],
verbose = TRUE)
}