mean_height: Calculate the vegetation height

View source: R/height.R

mean_heightR Documentation

Calculate the vegetation height

Description

Calculate the vegetation height

Usage

mean_height(
  height_tall,
  method = "mean",
  omit_zero = TRUE,
  by_line = FALSE,
  tall = FALSE,
  ...
)

Arguments

height_tall

A tall/long-format data frame. Use the data frame "height" from the gather.lpi() output.

method

Character string. Indicates the type of indicator, "max", which yields the average maximum height (of the herbaceous or woody heights) on the plot or "mean" which yields the mean height by functional group (woody/herbaceous).

omit_zero

Logical. If TRUE the results omit height measurements of 0. Defaults to TRUE.

by_line

Logical. If TRUE then the results will be calculated on a per-line basis. If FALSE then the results will be calculated on a per-plot basis. Defaults to FALSE.

tall

Logical. If TRUE then the returned data frame will be tall rather than wide and will not have observations for non-existent values e.g., if no data fell into a group on a plot, there will be no row for that group on that plot. Defaults to FALSE.

...

Optional bare variable names. One or more variable name from lpi.tall to calculate percent cover for, e.g. GrowthHabitSub to calculate percent cover by growth habits or GrowthHabitSub, Duration to calculate percent cover for categories like perennial forbs, annual graminoids, etc.

Examples

# Gather height data into tall format
height_tall <- gather_height(dsn = "Path/To/LMF_Geodatabase.gdb",
                    source = "LMF")
# Calculate woody and herbaceous height (specified in "type" field)
# All arguments must be named explicitly for this function to work correctly
height <- mean_height(height_tall,
                      method = "mean",
                      omit_zero = FALSE,
                      by_line = FALSE,
                      tall = FALSE,
                      type)



smccord/terradactyl documentation built on Dec. 1, 2023, 7:37 p.m.