generate_stand_from_trees: Generate stem maps from tables of individual trees

View source: R/generate_stand_from_trees.R

generate_stand_from_treesR Documentation

Generate stem maps from tables of individual trees

Description

This function simulates stem maps for stands, basing density and attributes on tree measurements provided to data.

Usage

generate_stand_from_trees(
  data,
  stand_area,
  ...,
  measured_area,
  cols = dplyr::everything()
)

Arguments

data

The data.frame

stand_area

sf object: The polygon to simulate trees within. Sampling is perfomed using sf::st_sample().

...

Passed to sf::st_sample().

measured_area

Either numeric (the total amount of area represented by data) of sf object (representing the measurement boundary). Used to calculate

cols

Names of columns to simulate for each new tree

Value

An sf object, representing new tree positions in the stem map, with simulated variables.

Examples

stand_area <- sf::st_bbox(c(xmin = 0, ymin = 0, xmax = 140, ymax = 140))
stand_area <- sf::st_as_sfc(stand_area)

measured_area <- 19600

trees <- tree_positions[c("SPECIES", "DBH85")]
trees$SPECIES <- factor(trees$SPECIES)

generate_stand_from_trees(
  trees,
  stand_area,
  measured_area = measured_area
)


mikemahoney218/forthetrees documentation built on March 29, 2023, 2:46 a.m.