Skip to contents

tsvis_nfi() function analyzes and visualizes data in a time series format. It can visualize 'biomass', 'cwd', and 'iv' data as 'table', 'line', 'bar', or 'map'. Users need to select the specific biomass variable, such as volume or carbon to visualize biomass. For map visualization of biomass, users must choose the administrative unit level. It uses the iv_nfi and biomass_nfi and cwd_biomass_nfi function for core calculations.

Usage

tsvis_nfi(
  data,
  y = "biomass",
  bm_type = NULL,
  output = "line",
  plotgrp = NULL,
  isannual = TRUE,
  admin = NULL,
  strat = "FORTYP_SUB",
  clusterplot = FALSE,
  largetreearea = TRUE,
  stockedland = TRUE,
  talltree = TRUE,
  sp = "SP",
  frequency = TRUE
)

Arguments

data

: A list generated by read_nfi that contains 'plot' and 'tree' data frames.

y

: A character vector; the variable to visualize. Must be one of 'biomass', 'cwd', 'iv'.

bm_type

: A character vector; the specific variable to visualize for 'biomass' or 'cwd'. Must be one of 'volume', 'biomass', 'AG_biomass', 'carbon', 'co2'.

output

: A character vector; the desired type of visualization. Must be one of 'table', 'line', 'bar', 'map'.

plotgrp

: A character vector; specifies variables from the 'plot' table to use for grouping. Use c() to combine multiple variables, but if the output is a map, line or bar plot, only one variable can be used.

isannual

: A logical flag (default TRUE); if TRUE, the result is provided annually, if FALSE, it is provided in 5-year intervals.

admin

: A character vector; the administrative unit for visualizing 'biomass' or 'cwd' as a map. Must be one of 'sido', 'sgg', 'emg'.

strat

: A character vector; the variable used for post-stratification. In the National Forest Inventory of Korea, it is typically used by forest type.

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 FALSE); 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.

sp

: A character vector; the column name of species information (e.g., "SP" for species, "GENUS" for genus-level analysis).

frequency

: A logical flag (default TRUE); if TRUE, includes frequency in importance value calculations.

Value

If the output is a map, line, or bar plot: an object of class ggplot. If the output is a table: a data.frame.

Note

To visualize data as a map, you need to agree to install the kadmin package during the function execution or install it in advance. The kadmin package loads shapefiles for Korea's Si, Do or Si, Gun, Gu or Eup, Myeon, Dong. Use drat::addRepo("SYOUNG9836") install.packages("kadmin") or remotes::install_github("SYOUNG9836/kadmin")

See also

iv_nfi for calculating the importance values. biomass_nfi for calculating the biomass. cwd_biomass_nfi for calculating the biomass of Coarse Woody Debris.

Examples


data("nfi_donghae")

# Visualize importance values as a table
tsvis_iv <- tsvis_nfi(nfi_donghae, y = "iv", output = "table")

# Create a bar plot of importance values at 5-year intervals
tsvis_iv_bar <- tsvis_nfi(nfi_donghae, y = "iv", output = "bar", isannual = FALSE)

# Generate a line plot of carbon biomass over time, grouped by age class
tsvis_bm_line <- tsvis_nfi(nfi_donghae, y = "biomass", 
                            bm_type = "carbon", output = "line", plotgrp = "AGE_CLS")
                            
# \donttest{
# Create a map of volume at the sido level
tsvis_bm_map <- tsvis_nfi(nfi_donghae, admin = "sido", 
                           y = "biomass", bm_type = "volume", output = "map")
# }