| dendroMetrics | R Documentation |
This function summarizes dendrometric data from the Spanish
National Forest Inventory (SNF). It primarily accepts a province
name or number, a local compressed SNF file, or a URL to a
compressed SNF file hosted by www.miteco.gob.es. It can
also process data frames previously returned by
readNFI, nfiMetrics, or
metrics2Vol. Dendrometric variables in the output
are transformed into stand units, see Details section.
dendroMetrics(nfi, summ.vr = "Estadillo",
metric_levels = NULL,
cut.dt = "d == d",
report = FALSE, mc.cores = getOption("mc.cores",
1L), domheight_method = "Hd_strict",
domheight_registry = dominant_height_method_registry(),
...)
nfi |
|
summ.vr |
|
metric_levels |
|
cut.dt |
|
report |
|
mc.cores |
|
domheight_method |
Dominant-height method used when
|
domheight_registry |
Named
dominant-height registry created
with |
... |
Additional arguments passed to |
Dendrometric variables are
summarized according to the levels of
argument summ.vr. Summary outputs
include the categorical columns defined
by summ.vr together with the
quantitative variables available after
processing with nfiMetrics
and metrics2Vol.
These variables may include tree basal
area ba ('m2 ha-1'), mean
diameter at breast height d
('cm'), quadratic mean diameter
dg ('cm'), mean tree
height h ('m'), total stand
density n_tot ('ha-1'), and over-bark
volume v ('m3 ha-1').
When summ.vr = NULL, the function
returns tree-level outputs from
metrics2Vol after applying
the filter defined in cut.dt.
When summ.vr is not NULL,
the function converts supported
variables to stand units, splits the data
by the requested grouping variable, and
computes summaries by group. The tree-level
expansion factor n is used internally for
weighting and summation; its group total is returned
as n_tot. Variables d,
h, and Hd, when present,
are returned as averages weighted by
n.
If both ba and n are
available, the function also derives the
quadratic mean diameter dg.
Output subsets are extracted using the
logical expression supplied in
cut.dt, see syntax in
Logic.
The function accepts one input object or
several inputs. When several inputs are
supplied, each one is processed
independently and the results are merged
into a single output data frame.
Parallel processing is controlled by
mc.cores. Values greater than 1
process several inputs in parallel.
data.frame. With summ.vr = NULL, tree-level output keeps
the expansion-factor column n. With grouped summaries, total stand
density is returned as n_tot. See Details.
Wilson Lara [aut, cre] (ORCID: <https://orcid.org/0000-0003-3527-1380>), Cristobal Ordonez [aut] (ORCID: <https://orcid.org/0000-0001-5354-3760>), Aitor Vázquez-Veloso [aut] (ORCID: <https://orcid.org/0000-0003-0227-506X>), Felipe Bravo [aut] (ORCID: <https://orcid.org/0000-0001-7348-6695>)
## Minimal precomputed metrics object with units
toy_metrics <- structure(
data.frame(
Estadillo = c("plot1", "plot1", "plot2"),
Especie = c("sp1", "sp2", "sp1"),
d = c(120, 185, 260), # mm
h = c(7.1, 9.4, 13.2), # m
ba = c(0.0113, 0.0269, 0.0531), # m2 tree-1
n = c(127.32, 31.83, 14.15),
stringsAsFactors = FALSE
),
class = c("nfiMetrics", "data.frame"),
units = c(
d = "mm",
h = "m",
ba = "m2 tree-1",
n = "ha-1"
),
nfi.nr = 4
)
## Summarize by plot
dendromet_toy <- dendroMetrics(toy_metrics, summ.vr = "Estadillo")
## Display output structure
str(dendromet_toy)
## The tree-level expansion factor n is summed and returned as n_tot
names(dendromet_toy)
attr(dendromet_toy, "units")
## Return tree-level processed data
tree_toy <- dendroMetrics(toy_metrics, summ.vr = NULL, cut.dt = "h > 8")
head(tree_toy)
## Alternatively, download data from 'www.miteco.gob.es'
## Specify province name/number and nfi number to compute dendrometrics.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.