compute_growth: Compute growth of trees

Description Usage Arguments Value See Also Examples

View source: R/data_processing_functions.R

Description

Based on two tree censuses, compute the average annual growth in dbh for all trees.

Usage

1
compute_growth(census_1, census_2, id)

Arguments

census_1

A data frame of the first census.

census_2

A data frame of the second (later) census

id

Name of variable that uniquely identifies each tree common to census_1 and census_2 allowing you to join/merge both data frames.

Value

An sf data frame with column growth giving the average annual growth in dbh.

See Also

Other data processing functions: create_bayes_lm_data(), create_focal_vs_comp()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr)
library(stringr)

growth_ex <-
  compute_growth(
    census_1 = census_1_ex %>%
      mutate(sp = to_any_case(sp) %>% factor()),
    census_2 = census_2_ex %>%
      filter(!str_detect(codes, "R")) %>%
      mutate(sp = to_any_case(sp) %>% factor()),
    id = "ID"
  )

forestecology documentation built on Oct. 2, 2021, 5:07 p.m.