compute_ba: Compute Basal Area in Forest Inventories

Description Usage Arguments Value Examples

View source: R/compute_ba.R

Description

compute_ba computes Basal Area according to user-specified grouping variables -e.g. Plot, species, etc- and time.

Usage

1
2
3
4
5
6
7
8
9
compute_ba(
  data,
  by = c("Plot", "binomial_name"),
  size_col = "size_corr",
  measure_type = getOption("measure_type"),
  time_col = getOption("time_col"),
  status_col = "status_corr",
  surface = 1.5625
)

Arguments

data

A data.frame containing a time-series tree-wise forest inventory -i.e. every line is a single tree measurement for a single year.

by

A character vector containing the name of the columns containing the variables -other than census time- according to which the result will be aggregated. Be it plots, subplots or species name...

size_col

character containing the name of the tree size measurements column -either circumference or diameter.

measure_type

A single character indicating whether tree sizes are given in circumferences -"C"- or diameter -"D"-.

time_col

A single character containing the name of the column corresponding to census years

status_col

Single character, the name of the column containing (corrected) tree life status

surface

Either a scalar containing the surface area of each plot -if they have the same dimensions- or a data.frame of the surface area according to some of the grouping variables -e.g. Plot and subplot. However, defaults to FALSE and in this case, only absolute BA is returned.

Value

A dataframe containing, for each combination of grouping variables, the plot-level and per-ha basal area for a given census year.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data("example_recruits")

ba_plots <- suppressWarnings(compute_ba(example_recruits,
size_col = "size_corr",
measure_type = "C",
time_col = "CensusYear",
by = "Plot",
surface = 1.5625))

ba_taxa <- suppressWarnings(compute_ba(example_recruits,
size_col = "size_corr",
measure_type = "C",
time_col = "CensusYear",
by = c("binomial_name","Plot"),
surface = 1.5625))

str(ba_plots)
head(ba_taxa)

EcoFoG/ForestData documentation built on Jan. 20, 2021, 10:04 a.m.