stemMapping: Map stems in a plot.

View source: R/stemMapping.R

stemMappingR Documentation

Map stems in a plot.

Description

The function is to map all the stems in a plot based on bearing and distance.

Usage

stemMapping(
  objectID,
  bearing,
  distance,
  plotShape = as.character(NA),
  plotSize,
  distanceUnit = "m",
  outputFormat,
  showID = TRUE
)

Arguments

objectID

character, A object's ID, e.g., a tree's ID.

bearing

numeric, Azimuth of a object from the north. It should be between 0 to 360.

distance

numeric, Distance between a object and the centre of the circle.

plotShape

character, circle, Rectangle or NA. NA means no plot shape information is not available and and no plot geometry will be produced.

plotSize

numeric, Defines the plot geoimetry. If plotShape is circular, a number must be provided as plot radius. If plotShape is rectangle, two numbers must be provided to determine length and width of a plot.

distanceUnit

character, Defines the unit in the stem mapping. Default is m.

outputFormat

character, Defines whether a table or a figure will be returned from this function.

showID

logical, Specifies whether the objectID will be showed in outputed figure. Default is TRUE.

Value

  1. A table contains the x and y for all the objects and the plot boundary. 2) a ggplot object will be returned for visualization.

Note

In the figure, IPC is the integrated plot center with x = 0 and y = 0.

Author(s)

Yong Luo

Examples

## Not run: 
## randomly generate some trees
bigplottrees <- data.table(tree_id = 1:20,
                           angle = runif(20, min = 0, max = 360),
                           distance = runif(20, min = 0, max = 11.28))
## output a table
stemmapped_table <- stemMapping(objectID = bigplottrees$tree_id,
                                         bearing = bigplottrees$angle,
                                         distance = bigplottrees$distance,
                                         plotShape = "circle",
                                         plotSize = 11.28,
                                         distanceUnit = "m",
                                         outputFormat = "table")

## output a figure
stemmapped_figure <- stemMapping(objectID = bigplottrees$tree_id,
                                         bearing = bigplottrees$angle,
                                         distance = bigplottrees$distance,
                                         plotShape = "circle",
                                         plotSize = 11.28,
                                         distanceUnit = "m",
                                         outputFormat = "figure",
                                         showID = TRUE)

## output a figure without a plot
stemmapped_figure <- stemMapping(objectID = bigplottrees$tree_id,
                                         bearing = bigplottrees$angle,
                                         distance = bigplottrees$distance,
                                         outputFormat = "figure",
                                         showID = TRUE)


## End(Not run)


bcgov/FAIBBase documentation built on June 19, 2024, 11:57 p.m.