knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(lfcdata)
The Spanish National Forest Inventory and the Catalonia Forest and Ecology Inventory contain
enough data to provide allometries for the most common forestry variables. This database
offers the allometries calculated at CREAF and
CTFC research centers.
In the database they are also included allometries provided by the Spanish National
Agricultural Research Insitute and the ones provided by
Montero et al.
and de Caceres et al.
papers.
To access the allometries use the allometries()
function:
allomdb <- allometries() allomdb
All allometries are presented in one table, with their main characteristics:
allom_table <- allometries_get_data(allomdb) allom_table
allometry level: At which plant level the allometry was calculated for, i.e. plant level or organ level.
spatial level: At which spatial level the allometry was calculated for, i.e. national, regional, county or municipality level
functional group level: At which functional group the allometry was calculated for, i.e. species level or genus level
variables: Dependent and independent variables used in the allometry
parameters: Parameters used in the allometry
equation: Equation of the allometry
source: Source of the allometry
cubication shape: At which cubication shape the allometry was calculated for
allometries_get_data(allomdb, 'thesaurus_cubication') |> dplyr::select(cubication_shape_id, description = translation_eng)
number of observations: Number of plants/organs/... used to calculate the allometry
r squared: R square of the fit of the allometry
standard error: Standard error of the fit of the allometry
allometries_describe_var
)allometries_describe_var(allomdb, c('DBH', 'DR'))
allometries_description
)bh_287 <- allometries_description(allomdb, id = 'BH_287') bh_287$BH_287$equation bh_287$BH_287$source
allom_list <- allometries_description(allomdb, dependent_var %in% c("GC", "BH")) length(allom_list) allom_list[[1]]$equation allom_list[[900]]$equation
We can obtain the same information as with allometries_get_data
, but in a nested list
format by no providing id or ... arguments:
allom_list <- allometries_description(allomdb) length(allom_list) allom_list[[1]]$equation
Allometries in the database can be used right away with the allometries_calculate
function (see ?allometries_calculate
). Vectors with the independent variables values
must be supplied, as well as the allometry identificator.
allometry_info <- allometries_description( allomdb, spatial_level_name == 'Alt Camp', functional_group_level_name == 'Ilex aquifolium', dependent_var == 'BH' ) allometry_info$BH_287$independent_var_1 allometries_calculate(allomdb, DR = c(5.5, 4.6, 3.7), allometry_id = "BH_287")
It can be used inside in combination with dplyr:
library(dplyr) dummy_data <- data.frame( branch_diameter = c(5.5, 4.6, 3.7) ) dummy_data |> mutate( leaves_biomass = allometries_calculate( allomdb, DR = branch_diameter, allometry_id = 'BH_287' ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.