Learn R Programming

silviculture (version 0.2.0)

silv_tree_dclass: Classify diameters in classes

Description

Classifies the measured diameters into classes of a specified length

Usage

silv_tree_dclass(
  diameter,
  dmin = 7.5,
  dmax = NULL,
  class_length = 5,
  include_lowest = TRUE,
  return_intervals = FALSE
)

Value

A numeric vector

Arguments

diameter

A numeric vector of diameters

dmin

The minimum inventory diameter in centimeters

dmax

The maximum inventory diameter in centimeters. Values that are greater than dmax are included in the greatest class

class_length

The length of the class in centimeters

include_lowest

Logical. If TRUE (the default), the intervals are [dim1, dim2). If FALSE, the intervals are (dim1, dim2]

[dim1, dim2). If FALSE, the intervals are (dim1, dim2]: R:dim1,%20dim2)%60.%20If%20FALSE,%20the%20intervals%20are%20%60(dim1,%20dim2

return_intervals

If FALSE, it returns the intervals. Otherwise (the default), it returns the class center

Examples

Run this code
library(dplyr)
inventory_samples |>
  mutate(dclass = silv_tree_dclass(diameter))

Run the code above in your browser using DataLab