View source: R/addPlotObservations.R
| addPlotObservations | R Documentation |
Adds plot observation records to a VegX object from a data table where rows are plot observations.
addPlotObservations( target, x, mapping, missing.values = c(NA, ""), date.format = "%Y-%m-%d", verbose = TRUE )
target |
The initial object of class |
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
|
missing.values |
A character vector of values that should be considered as missing data (see details). |
date.format |
A character string specifying the input format of dates (see |
verbose |
A boolean flag to indicate console output of the data integration process. |
Named elements in mapping beyond those used by this function will be ignored. Missing value policy:
Missing projectTitle, plotName, obsStartDate or obsEndDate values are interpreted as if the previous non-missing value has to be used to define plot observation.
Missing subPlotName values are interpreted in that data refers to the parent plotName.
The modified object of class VegX.
Wiser SK, Spencer N, De Caceres M, Kleikamp M, Boyle B & Peet RK (2011). Veg-X - an exchange standard for plot-based vegetation data
Other add functions:
addAggregateOrganismObservations(),
addCommunityObservations(),
addIndividualOrganismObservations(),
addPlotGeometries(),
addPlotLocations(),
addSiteCharacteristics(),
addSiteObservations(),
addStratumObservations(),
addSurfaceCoverObservations(),
addTaxonBySiteData()
# Load source data
data(mokihinui)
# Define mapping
mapping = list(projectTitle = "Project", plotName = "Plot", subPlotName = "Subplot",
obsStartDate = "PlotObsStartDate", obsEndDate = "PlotObsStopDate")
# Create a new Veg-X document with projects, plots and plot observations (no data)
x = addPlotObservations(newVegX(), moki_site, mapping = mapping)
# Examine the result
showElementTable(x, "plot")
showElementTable(x, "plotObservation")
# The same but capturing unique identifiers from data source IDs (not used by the Veg-X package)
mapping = list(projectTitle = "Project", plotName = "Plot", subPlotName = "Subplot",
obsStartDate = "PlotObsStartDate", obsEndDate = "PlotObsStopDate",
plotUniqueIdentifier = "PlotID", plotObservationUniqueIdentifier = "PlotObsID")
x = addPlotObservations(newVegX(), moki_site, mapping = mapping)
showElementTable(x, "plot")
showElementTable(x, "plotObservation")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.