vegTypeGenerator: Generate and add vegetation type column to 'cohortData'

vegTypeGeneratorR Documentation

Generate and add vegetation type column to cohortData

Description

This function is a simplification of vegTypeMapGenerator and instead of generating a map, it adds the vegetation type column to the cohortData table.

Usage

vegTypeGenerator(
  x,
  vegLeadingProportion = 0.8,
  mixedType = 2,
  sppEquiv = NULL,
  sppEquivCol,
  pixelGroupColName = "pixelGroup",
  doAssertion = getOption("LandR.assertions", TRUE),
  ...
)

Arguments

x

A cohortData object

vegLeadingProportion

Numeric between 0-1, determining the relative biomass threshold a species needs to pass to be considered "leading".

mixedType

An integer defining whether mixed stands are: not differentiated (0), any kind of species admixture (1), or deciduous mixed with conifer (2; default).

sppEquiv

table with species name equivalencies between the kNN and final naming formats. See data("sppEquivalencies_CA", "LandR"). For functions that have mixedType, this only necessary if mixedType == 2. If not provided and mixedType == 2, will attempt to use data("sppEquivalencies_CA", "LandR").

sppEquivCol

the column name to use from sppEquiv. For functions that have mixedType, only necessary if mixedType == 2. If not provided and mixedType == 2, will attempt to use "Boreal".

pixelGroupColName

Name of the column in pixelGroup to use.

doAssertion

A logical indicating whether some internal tests should be run to ensure the function is running correctly. Default: getOption("LandR.assertions", TRUE).

...

Additional arguments.

Value

x with a new column, 'leading', coding the vegetation type of each group defined by pixelGroupColName

Author(s)

Eliot McIntire, Ceres Barros, Alex Chubaty

Examples

library(data.table)
x <- data.table(
  pixelGroup = rep(1:2, each = 2), B = c(100, 200, 20, 400),
  speciesCode = rep(c("Pice_Gla", "Popu_Tre"), 2)
)
vegTypeGenerator(x)

PredictiveEcology/LandR documentation built on June 7, 2024, 4:16 p.m.