Description Usage Arguments Value Author(s) See Also Examples
Convert continuous numeric variables to class intervals with output as factor or numeric classes. Simplified implementation of cut
. Example uses include computing diameter or height classes for summarization with rFIA functions (e.g. tpa
, biomass
).
1 2 |
x |
numeric vector to be converted to factor (class intervals). |
interval |
numeric; interval of desired output classes. e.g. specify |
lower |
lower bound of output classes, included in lowest class. e.g. [ |
upper |
upper bound of output classes, NOT included in highest class. e.g. [..., |
brks |
numeric vector of desired breakpoints (bounds) of class intervals. |
numLabs |
logical; if TRUE, return class intervals as numeric vector with values representing the lower bounds of each interval. If FALSE, return factor with labels of form |
Factor or integer vector. Factor values represent class intervals with [b1, b2)
notation, values of integer vectors represent the lower bounds of class intervals (e.g. b1
).
Hunter Stanke and Andrew Finley
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Load data from the rFIA package
data(fiaRI)
## Compute Diameter Classes on 1-inch intervals for each tree in TREE table ----
# Factor w/ interval labels
makeClasses(fiaRI$TREE$DIA, interval = 1)
# Numeric w/ lower bound of each class as returned value
makeClasses(fiaRI$TREE$DIA, interval = 1, numLabs = TRUE)
## Compute Stand Age Classes on 20 year intervals for each
## condition in COND table ----
# NOTE: Unrecorded stand age recorded as -999, replace negative values with NA
fiaRI$COND$STDAGE[fiaRI$COND$STDAGE < 0] <- NA
makeClasses(fiaRI$COND$STDAGE, interval = 25)
## Compute Stand Stocking Classes (10%) for all live (ALSTK),
## and growing stock (GSSTK) in COND table ----
makeClasses(fiaRI$COND$ALSTK, interval = 10) # All Live
makeClasses(fiaRI$COND$GSSTK, interval = 10) # Growing Stock
## Compute % Slope Classes (20%) for each condition in COND table ----
makeClasses(fiaRI$COND$SLOPE, interval = 20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.