sep.dbh {CTFS} | R Documentation

## Creates a Vector of DBH Classes for each Tree in a Dataset

### Description

`sep.dbh` creates a vector of the same length as the input data file that contains the value for the DBH class of the tree. This vector can be used with `mortality`, `growth`, `recruitment`, and `abundance` to compute rates and counts for each DBH class. This function can also be used as a template for writing other functions that use the function `cut` which "bins" values into user defined bins (classes).

### Usage

    sep.dbh(census1, dbhclass = c(10, 100, 300))

### Arguments

`census1` | usually a tree data file which is a dataframe, but any object with a dim=NULL is also allowed
`dbhclass` | lower class boundaries for DBH classes, classes are nonoverlapping, no maximum dbh needed

### Details

This function is usually used to create a vector of dbh classes for each tree in a census file. However, it can also be used, usually within another function, to generate a vector of dbh classes from a vector of dbh values. This usage can make such code much more simple as the cut function, labels and class limits are handled by `sep.dbh`.

### Value

`sep.dbh` returns a vector of values which have the mode `factor`

### Author(s)

Pamela Hall

### See Also

`CTFS.utilities`, `CTFS.quadfunctions`, `CTFS.datafiles`

### Examples

    ## Not run:
    1. Default use of sep.dbh
    dbh.vct <- sep.dbh(tst.bci90.full)
    dbh.vct[1:5]

    2. User defined census and dbhclasses
    dbh.vct <- sep.dbh(tst.bci90.full,dbhclass=c(10,20,30,40,50))
    dbh.vct[1:5]

    3. Using a vector of dbh values
    dbh1.vct <- sep.dbh(tst.bci90.full$dbh)
    ## End(Not run)

[Package CTFS version 1.00 Index]