silv_density_ntrees_ha: Calculates number of trees per hectare

View source: R/metrics-stand-density.R

silv_density_ntrees_haR Documentation

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")

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

Value

A numeric vector

Examples

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"
     )
  )

silviculture documentation built on Nov. 5, 2025, 7:13 p.m.