Learn R Programming

silviculture (version 0.2.0)

silv_density_ntrees_ha: Calculates number of trees per hectare

Description

Calculates number of trees per hectare for a given plot size and shape

Usage

silv_density_ntrees_ha(ntrees, plot_size, plot_shape = "circular")

Value

A numeric vector

Arguments

ntrees

A numeric vector representing the number of trees in a sampling plot

plot_size

A numeric vector of length one for circular radius in meters; or a numeric vector of length two for each side of a rectangular plot shape

plot_shape

The shape of the sampling plot. Either circular or rectangular

Examples

Run this code
library(dplyr)
## Circular plot of 10 meters radius
inventory_samples |>
  count(plot_id, species) |>
  mutate(
    ntrees_ha = silv_density_ntrees_ha(n, plot_size = 10)
  )

## Rectangular plot of 10x15 meters
inventory_samples |>
  count(plot_id, species) |>
  mutate(
    ntrees_ha = silv_density_ntrees_ha(
      n,
      plot_size = c(10, 15),
      plot_shape = "rectangular"
     )
  )

Run the code above in your browser using DataLab