Calculate descriptive statistics for National Forest Inventory Data
Source:R/summary_nfi.R
summary_nfi.Rd
summary_nfi() is a function that calculates comprehensive descriptive statistics for National Forest Inventory (NFI) data.
It can provide summaries for individual plots, the entire study area, or specific groups within the study area using parameters byplot
or plotgrp
.
Users have flexibility in specifying data inclusion criteria and analysis levels using parameters clusterplot
, largetreearea
, stockedland
, and talltree
.
These parameters determine whether to treat cluster plots as single plots, to include large tree survey plots, and to focus only on Stocked land and tall trees.
Usage
summary_nfi(
data,
byplot = FALSE,
plotgrp = NULL,
continuousplot = FALSE,
clusterplot = FALSE,
largetreearea = TRUE,
stockedland = TRUE,
talltree = TRUE
)
Arguments
- data
: A
list
containing 'plot' and 'tree' data frames, typically generated byread_nfi
.- byplot
: A logical flag (default FALSE); if TRUE, calculates statistics for each plot separately. If FALSE, calculates for the entire dataset.
- plotgrp
: A character vector; specifies variables from 'plot' table to use for grouping. Use
c()
to combine multiple variables.- continuousplot
: A logical flag (default TRUE); if TRUE, includes only plots that have been continuously measured in all NFI cycles (5th, 6th, etc.). If FALSE, includes plots regardless of missing cycle measurements.
- clusterplot
: A logical flag (default FALSE); if TRUE, treats each cluster plot as a single unit. If FALSE, calculates for each subplot separately.
- largetreearea
: A logical flag (default TRUE); if TRUE, includes large tree survey plots in the analysis. If FALSE, only uses standard tree plots.
- stockedland
: A logical flag (default TRUE); if TRUE, includes only stocked land. If FALSE, includes all land types.
- talltree
: A logical flag (default TRUE); if TRUE, includes only tall trees. If FALSE, includes both trees and shrubs.
Value
A data.frame
that includes summary statistics.
The structure depends on the input parameters:
If
byplot = TRUE
, each row represents a plot.If
byplot = FALSE
, each row represents the entire dataset or a group specified byplotgrp
Details
The function calculates the following statistics: Plot-related statistics:
Number of cluster plots
Number of subplots
Number of subplots with large trees (\(\geq\) 30cm) observed
Tree-related statistics:
Number of individual trees
Number of large trees
Number of dominant trees
Number of tree species
Tree measurements and stand statistics (mean and standard deviation):
DBH (Diameter at Breast Height)
Tree height
Height of dominant trees
Number of trees per hectare
Basal area per hectare
Volume per hectare
The largetreearea
parameter affects calculations differently:
For per-hectare statistics (trees per hectare, basal area per hectare, volume per hectare), setting
largetreearea = TRUE
includes data from large tree survey plots.For all other statistics, trees from large tree survey plots are always excluded, regardless of the
largetreearea
setting.
Examples
data("nfi_donghae")
# Basic usage
summary_stats <- summary_nfi(nfi_donghae, continuousplot = TRUE)
# Summarize by the group, including all land types
grouped_stats <- summary_nfi(nfi_donghae, plotgrp = "OWN_CD",
stockedland = FALSE, continuousplot = TRUE)
# Summarize by individual plots, including both trees and shrubs
plot_summaries <- summary_nfi(nfi_donghae, byplot = TRUE, talltree = FALSE)