View source: R/addCommunityObservations.R
addCommunityObservations | R Documentation |
Adds community observation records to a VegX object from a data table where rows are plot observations.
addCommunityObservations( target, x, mapping, methods = list(), date.format = "%Y-%m-%d", missing.values = c(NA, ""), 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 list with element names 'plotName', 'obsStartDate', used to specify the mapping of data columns (specified using strings for column names) onto these variables. Additional optional mappings are: 'subPlotName'. |
methods |
A named list of objects 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. |
Missing value policy:
Missing 'plotName' or 'obsStartDate' 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 observation refers to the parent plotName.
Missing measurements are simply 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()
,
addIndividualOrganismObservations()
,
addPlotGeometries()
,
addPlotLocations()
,
addPlotObservations()
,
addSiteCharacteristics()
,
addSiteObservations()
,
addStratumObservations()
,
addSurfaceCoverObservations()
,
addTaxonBySiteData()
data(Mokihinui) # Simulate measurement of basal area moki_site$BA = pmax(0, rnorm(nrow(moki_site), 10, 5)) # Define mapping mapping = list(plotName = "Plot", subPlotName = "Subplot", obsStartDate = "PlotObsStartDate", basal_area = "BA") x = addCommunityObservations(newVegX(), moki_site, mapping = mapping, methods = list(basal_area = "Basal area/m2*ha-1")) # Inspect the result head(showElementTable(x, "communityObservation"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.