| nfiMetrics | R Documentation |
Compute tree-level diameter, height, basal area, trees per
hectare, and optional dominant height from Spanish National Forest
Inventory inputs. Supply either an object returned by
readNFI or a path/URL that readNFI
can import. The function returns the requested metrics together
with the matched grouping columns and attaches unit metadata to the
result.
nfiMetrics(nfi, var = c("d",
"h", "ba", "n", "Hd",
"Dd"), levels = c("esta",
"espe"), design = snfi_design(),
domheight_method = "Hd",
domheight_registry = dominant_height_method_registry(),
...)
nfi |
|
var |
|
levels |
|
design |
Sampling |
domheight_method |
|
domheight_registry |
Named registry created with |
... |
Additional arguments passed to |
If you request 'Hd', the function computes
dominant height within the groups selected by
levels by using 'h', 'd', and
'n'. The active method is resolved through
domheight_registry; inspect
dominant_height_method_registry()$Hd to see the
equation, selection rule, threshold, variables, and fallback.
data.frame with the matched identifier and grouping
columns plus the metrics requested in var. The output
inherits from 'nfiMetrics' and 'data.frame' and
stores attr(x, 'nfi.nr') when available. Inspect
attr(x, 'units') for the returned metric units and
attr(x, 'design_meta') for the sampling design summary
attached when 'n', 'Hd', or 'Dd' is requested. When 'Hd'
is requested, inspect attr(x, 'dominant_height_meta') to see the
method code, equation, selection rule, threshold, and fallback.
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>)
dendroMetrics, dbhMetric, readNFI, snfi_design, trees_per_ha, dominant_height_method_registry
## Minimal reproducible example with a small object that mimics
## readNFI() output
toy_ifn <- structure(
data.frame(
esta = c("plot1", "plot1", "plot2"),
espe = c("sp1", "sp2", "sp1"),
Dn = c(120, 185, 260),
altura = c(7.1, 9.4, 13.2),
stringsAsFactors = FALSE
),
class = c("readNFI", "data.frame"),
nfi.nr = 4
)
x <- nfiMetrics(
toy_ifn,
var = c("d", "h", "ba", "n"),
levels = c("esta", "espe")
)
x
attr(x, "units")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.