sampleLogs: Generates a Synthetic Population of Down Log Attributes

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

View source: R/sampleLogs.R

Description

This routine will allow the generation of a collection of synthetic down log attributes in a data.frame. Note that the function returns a collection of log attributes in the sense of dimensions, etc., and not a collection of downLog 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
11
sampleLogs(nLogs = 2,
           buttDiams = c(8, 40),
           topDiams = c(0, 0.9),
           logLens = c(1, 10),
           logAngles = c(0, 2 * pi),
           solidTypes = c(1, 10),
           species = .StemEnv$species,
           sampleRect = NULL,
           startSeed = NA,
           runQuiet = FALSE,
           ...)

Arguments

nLogs

The number of logs in the collection.

buttDiams

A length-two vector specifying the range of butt (large-end) diameters from which to uniformly draw the sample.

topDiams

A length-two vector specifying the range of top (small-end) diameters, in the form of a proportion of the buttDiam diameters, from which to uniformly draw the sample.

logLens

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

logAngles

A length-two vector specifying the range of log angles from which to draw the log lie angles; these are always counterclockwise relative to due East.

solidTypes

A length-two vector specifying the range in the log 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 log centers 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 lengths are reasonable for whatever system (i.e., "English" or "metric") one is working in. For example, if metric units are used, buttDiams would be in centimeters, while logLens would be in meters.

Value

A data frame with columns: species, logLen, buttDiam, topDiam, solidType, x, y, logAngle, logAngle.D where x,y is the center point of the log and logAngle.D is in degrees.

Author(s)

Jeffrey H. Gove

See Also

downLogs-methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#
#  draw from a unit square...
#
sampleLogs(species=c('ewp','sm','978'),buttDiams=c(1,10), logLens=c(3,6))
#
# draw from a buffer...
#
bufftr = bufferedTract(10, Tract(c(x=50,y=50),cellSize=0.5))
sl = sampleLogs(10, sampleRect=bufftr@bufferRect, buttDiams=c(25,40))
dlogs = downLogs(sl)
plot(bufftr, axes=TRUE, gridColor='grey80')
plot(dlogs, add=TRUE)

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