showElementTable: Coerces VegX elements into a data frame

View source: R/showElementTable.R

showElementTableR Documentation

Coerces VegX elements into a data frame

Description

Coerces part of the information of a Veg-X object into a data frame

Usage

showElementTable(
  x,
  element = "plot",
  IDs = FALSE,
  subjects = FALSE,
  max.nchar = 30
)

Arguments

x

An object of class VegX

element

The name of the main element to be coerced: 'project', 'plot', 'party', 'plotObservation', 'organismIdentity', 'stratum', 'stratumObservation', 'surfaceType', 'surfaceCoverObservation', 'aggregateOrganismObservation', 'individualOrganism', 'individualOrganismObservation', 'communityObservation', 'siteObservation', 'method', 'attribute', 'literatureCitation'.

IDs

A boolean flag to indicate whether internal identifiers should be included in the output.

subjects

A boolean flag to indicate whether method subjects should be included in the output.

max.nchar

Maximum number of characters in strings

Value

a data frame

Examples

data(mokihinui)

# Create document 'x' with aggregate organism observations
mapping = list(plotName = "Plot", obsStartDate = "PlotObsStartDate",
               taxonName = "NVSSpeciesName",
               stratumName = "Tier", cover = "Category")
coverscale = defineOrdinalScaleMethod(name = "Recce cover scale",
                   description = "Recce recording method by Hurst/Allen",
                   subject = "plant cover",
                   citation = "Hurst, JM and Allen, RB. (2007) 
                      The Recce method for describing New Zealand vegetation – Field protocols. 
                      Landcare Research, Lincoln.",
                   codes = c("P","1","2","3", "4", "5", "6"),
                   quantifiableCodes = c("1","2","3", "4", "5", "6"),
                   breaks = c(0, 1, 5, 25, 50, 75, 100),
                   midPoints = c(0.05, 0.5, 15, 37.5, 62.5, 87.5),
                   definitions = c("Presence", "<1%", "1-5%","6-25%", "26-50%", 
                                   "51-75%", "76-100%"))
strataDef = defineMixedStrata(name = "Recce strata",
                   description = "Standard Recce stratum definition",
                   citation = "Hurst, JM and Allen, RB. (2007) 
                     The Recce method for describing New Zealand vegetation – Field protocols. 
                     Landcare Research, Lincoln.",
                   heightStrataBreaks = c(0, 0.3,2.0,5, 12, 25, 50),
                   heightStrataNames = paste0("Tier ",1:6),
                   categoryStrataNames = "Tier 7",
                   categoryStrataDefinition = "Epiphytes")
x = addAggregateOrganismObservations(newVegX(), moki_tcv,
                   mapping = mapping,
                   methods = c(cover=coverscale),
                   stratumDefinition = strataDef)

# Summary
summary(x)

# show plot information
showElementTable(x, "plot")

# show plot observation information
showElementTable(x, "plotObservation")

# show methods, attributes, citations
showElementTable(x, "method")
showElementTable(x, "attribute")
showElementTable(x, "literatureCitation")

# show aggregate organism observations (only some of them)
head(showElementTable(x, "aggregateOrganismObservation"))

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