groupDBH {Mensuration}R Documentation

Group DBH values into Classes.

Description

This is used in conjunction with dbhClassLimits to simply group the raw diameters into class midpoints.

Usage

groupDBH(dbh, classLimits)

Arguments

dbh

a vector of diameter values to be classed.

classLimits

A data frame with lower, mid and upper class limits from dbhClassLimits.

Details

This just computes the diameter classes based on the midpoints of the class for all dbh values passed. If any diameters lie outside the chosen limits, they are marked as NA and a warning is issued.

Value

A list with...

dbh.grp

A vector with midpoint diameter classes.

idx

A vector of the integer index values of each diameter in the class limits data frame.

Author(s)

JHG.

See Also

dbhClassLimits, or for a complete stand table along the lines of the example below, standTable.

Examples

lims = dbhClassLimits()
dbh = rexp(40, .25)      #some diameters
gd = groupDBH(dbh, lims)
rbind(gd$dbh.grp, dbh)
table(gd$dbh.grp)
dbhcl = factor(groupDBH(dbh, lims)$dbh.grp, levels=lims[,2])
as.data.frame(table(dbhcl))

[Package Mensuration version 1.1-3 Index]