addPlotGeometries: Adds/replaces plot geometry information

View source: R/addPlotGeometries.R

addPlotGeometriesR Documentation

Adds/replaces plot geometry information

Description

Adds/replaces static plot geometry information (plot shape, dimensions, ...) to plot elements of a VegX object from a data frame where rows are plots.

Usage

addPlotGeometries(
  target,
  x,
  mapping,
  methods = list(),
  missing.values = c(NA, ""),
  verbose = TRUE
)

Arguments

target

The initial object of class VegX to be modified.

x

A data frame where each row corresponds to one plot. Columns can be varied.

mapping

A named list whose elements are strings that correspond to column names in x. Names of the list should be: #'

  • plotName - A string identifying the vegetation plot within the data set (required).

  • subPlotName - A string identifying a subplot of the plot given by plotName (optional).

  • area - Area of the plot (optional).

  • shape - Shape of the plot: circle/circular, rectangle/rectangular/squared, line/linear (optional).

  • radius - Radius of the plot, for circular plots (optional).

  • width - Width of the plot, for rectangular plots (optional).

  • length - Length of the plot, for linear and rectangular plots (optional).

  • bandWidth - Sampling bandwidth, for linear plots (optional).

methods

A list measurement methods for plot geometry measurements (each being an object of class VegXMethodDefinition). Alternatively, methods can be specified using strings if predefined methods exist (see predefinedMeasurementMethod).

missing.values

A character vector of values that should be considered as missing data.

verbose

A boolean flag to indicate console output of the data integration process.

Details

Named elements in mapping beyond those used by this function will be ignored. Missing value policy:

  • Missing plotName and shape values are interpreted as if the previous non-missing value has to be used to define plot.

  • Missing subPlotName values are interpreted in that data refers to the parent plotName.

  • Missing measurements (e.g. area, radius,...) are simply not added to the Veg-X document.

Value

The modified object of class VegX.

References

Wiser SK, Spencer N, De Caceres M, Kleikamp M, Boyle B & Peet RK (2011). Veg-X - an exchange standard for plot-based vegetation data

See Also

Other add functions: addAggregateOrganismObservations(), addCommunityObservations(), addIndividualOrganismObservations(), addPlotLocations(), addPlotObservations(), addSiteCharacteristics(), addSiteObservations(), addStratumObservations(), addSurfaceCoverObservations(), addTaxonBySiteData()

Examples

# Load source data
data(mokihinui)

# Define location mapping
mapping = list(plotName = "Plot", subPlotName = "Subplot",
               area = "PlotArea", shape = "Shape",
               width = "PlotRectangleLength01", length = "PlotRectangleLength02")

# Define methods
methods = list(area = "Plot area/m2", 
               width = "Plot dimension/m", length = "Plot dimension/m") 

# Create new Veg-X document with plot locations
x = addPlotGeometries(newVegX(), moki_site, mapping, methods)

# Inspect results
showElementTable(x, "plot")


miquelcaceres/VegX documentation built on Sept. 18, 2022, 7:04 p.m.