addSiteCharacteristics: Adds/replaces site information

View source: R/addSiteCharacteristics.R

addSiteCharacteristicsR Documentation

Adds/replaces site information

Description

Adds/replaces static site characteristics (topography, geology, ...) to plot elements of a VegX object from a data frame where rows are plots.

Usage

addSiteCharacteristics(
  target,
  x,
  mapping,
  measurementMethods = 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 observation. 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).

  • slope - Slope of the plot (optional).

  • aspect - Aspect (i.e. orientation) of the plot (optional).

  • landform - Site land form (e.g. slope, ridge, saddle point; optional).

  • parentMaterial - Underlying geological material (generally bedrock or a superficial or drift deposit) in which soil horizons form. (optional).

measurementMethods

A named list of objects of class VegXMethodDefinition with the measurement method for each of the site variables stated in mapping. List names should be the same as the names of site variables (e.g. list(aspect = aspectMeth) to specify the use of method aspectMeth for aspect measurements). Alternatively, methods can be specified using strings if a predefined method exists (e.g. list(aspect = "Aspect/degrees")), see predefinedMeasurementMethod.

missing.values

A character vector of values that should be considered as missing observations/measurements.

verbose

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

Details

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

  • Missing plotName 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. aspect, slope,...) 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(), addPlotGeometries(), addPlotLocations(), addPlotObservations(), addSiteObservations(), addStratumObservations(), addSurfaceCoverObservations(), addTaxonBySiteData()

Examples

# Load source data
data(mokihinui)

# Define mapping
sitemapping = list(plotName = "Plot", subPlotName = "Subplot",
                   slope = "PlotSlope", aspect = "PlotAspect")


# Create new Veg-X document with site characteristics
x = addSiteCharacteristics(newVegX(), moki_site, mapping = sitemapping,
                           measurementMethods = list(slope = "Slope/degrees", 
                                                     aspect = "Aspect/degrees"))

# Inspect the result
showElementTable(x, "plot")


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