groupDBH {Mensuration} | R Documentation |
This is used in conjunction with
dbhClassLimits
to simply group the raw diameters into
class midpoints.
groupDBH(dbh, classLimits)
dbh |
a vector of diameter values to be classed. |
classLimits |
A data frame with lower, mid and upper class
limits from |
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.
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. |
JHG.
dbhClassLimits
, or for a complete stand table
along the lines of the example below, standTable
.
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))