sampleTrees: Generates a Synthetic Population of Standing Tree Attributes

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sampleTrees.R

Description

This routine will allow the generation of a collection of synthetic standing tree attributes in a data.frame. Note that the function returns a collection of tree attributes in the sense of dimensions, etc., and not a collection of standingTree objects, although it can be used to generate one if desired (see examples). Please see “The Stem Class” vignette for more details.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sampleTrees(nTrees = 2,
            dbhs = c(8, 40),
            topDiams = c(0.4, 0.9),
            heights = c(5, 15),
            solidTypes = c(1, 10),
            species = .StemEnv$species,
            sampleRect = NULL,
            startSeed = NA,
            runQuiet = FALSE,
            ...)

Arguments

nTrees

The number of trees in the collection.

dbhs

A length-two vector specifying the range of breast height diameters from which to uniformly draw the sample.

topDiams

A length-two vector specifying the range of top diameters, in the form of a proportion of the dbh diameters, from which to uniformly draw the sample.

heights

A length-two vector specifying the range of tree heights from which to uniformly draw the sample.

solidTypes

A length-two vector specifying the range in the tree shape parameter for the default taper and volume equations; where: 1-2 is a neiloid, 2 is a cone, and >2 is a paraboloid.

species

A character vector of possible species from which to draw the sample uniformly. This can be any legal character string, and so can include codes, names, Latin names, etc.

sampleRect

A rectangle delineating the area within which the tree centers (pith at dbh) will be sampled from. It must be in the form of a valid bbox matrix. If NULL or NA, a unit square bounding box will be created.

startSeed

A numeric start seed for the random number generator. NA will continue with the current random number stream if available, or create one if not.

runQuiet

TRUE: No feedback; FALSE: a little feedback.

...

Not used at present, just gobbles up other arguments.

Details

This routine does not care about units, it is up to the user to make sure that the ranges for diameters and heights are reasonable for whatever system (i.e., "English" or "metric") one is working in. For example, if metric units are used, dbhs would be in centimeters, while heights would be in meters.

Value

A data frame with columns: species, height, dbh, topDiam, solidType, x, y where x,y is the center point of the tree pith at dbh.

Author(s)

Jeffrey H. Gove

See Also

standingTrees-methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#
#  draw from a unit square (metric default)...
#
sampleTrees(species=c('ewp','sm','978'),dbhs=c(4,10), heights=c(3,6))
#
# draw from a buffer...
#
bufftr = bufferedTract(10, Tract(c(x=50,y=50),cellSize=0.5))
st = sampleTrees(10, sampleRect=bufftr@bufferRect, dbhs=c(20,40))
strees = standingTrees(st)
plot(bufftr, axes=TRUE, gridColor='grey80')
plot(strees, add=TRUE)

sampSurf documentation built on March 5, 2021, 5:06 p.m.