View source: R/addIndividualOrganismObservations.R
addIndividualOrganismObservations | R Documentation |
Adds individual organism observation records to a VegX object from a data frame where rows are individual observations.
addIndividualOrganismObservations( target, x, mapping, methods = list(), stratumDefinition = NULL, date.format = "%Y-%m-%d", missing.values = c(NA, "0", ""), verbose = TRUE )
target |
The initial object of class |
x |
A data frame where each row corresponds to one individual organism (e.g. a tree) observation. Columns can be varied. |
mapping |
A named list whose elements are strings that correspond to column names in
|
methods |
A named list of objects of class |
stratumDefinition |
An object of class |
date.format |
A character string specifying the input format of dates (see |
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. |
The mapping should include either organismName
or taxonName
, but can include both of them if the source data set contains both taxon names
and others that are not taxa. Missing value policy:
Missing plotName
or obsStartDate
values are interpreted as if the previous non-missing value has to be used to define individual organism observation.
Missing subPlotName
values are interpreted in that observation refers to the parent plotName.
When both organismName
and taxonName
are missing the organism is assumed to be unidentified (i.e. no identity is added).
When individualOrganismLabel
is missing the function creates a label for the organism.
When stratumName
values are missing the individual organism observation is not assigned to any stratum.
Missing measurements (e.g. diameterMeasurement
) are not added to the Veg-X document.
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()
,
addPlotGeometries()
,
addPlotLocations()
,
addPlotObservations()
,
addSiteCharacteristics()
,
addSiteObservations()
,
addStratumObservations()
,
addSurfaceCoverObservations()
,
addTaxonBySiteData()
# Load source data data(mtfyffe) # Define mapping mapping = list(plotName = "Plot", subPlotName = "Subplot", obsStartDate = "PlotObsStartDate", taxonName = "NVSSpeciesName", individualOrganismLabel = "Identifier", diameterMeasurement = "Diameter") # Create new Veg-X document with individual organism observations x = addIndividualOrganismObservations(newVegX(), mtfyffe_dia, mapping, methods = list(diameterMeasurement = "DBH/cm"), missing.values = c(NA, "(Unknown)", "0","")) # Inspect the result head(showElementTable(x, "individualOrganismObservation")) # Second example without individual labels data(mokihinui) mapping = list(plotName = "Plot", subPlotName = "Subplot", obsStartDate = "PlotObsStartDate", taxonName = "NVSSpeciesName", diameterMeasurement = "Diameter") x = addIndividualOrganismObservations(newVegX(), moki_dia, mapping = mapping, methods = list(diameterMeasurement = "DBH/cm"), missing.values = c(NA, "(Unknown)", "0","")) head(showElementTable(x, "individualOrganismObservation"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.