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

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)
#>  1 additional aggregate organism measurements found: Category.
#>  Measurement method 'Recce cover scale' added for 'cover'.
#>  Stratum definition method 'Recce strata' added.
#>  7 new stratum definitions added.
#>  5 plot(s) parsed, 5 new added.
#>  5 plot observation(s) parsed, 5 new added.
#>  148 organism names(s) parsed, 148 new added.
#>  148 organism identitie(s) parsed, 148 new added.
#>  33 stratum observation(s) parsed, 33 new added.
#>  582 record(s) parsed, 582 new aggregate organism observation(s) added.

# Summary
summary(x)
#> ================================================================
#>                     Veg-X object (ver 2.0.0)                   
#> ----------------------------------------------------------------
#> 
#>    Projects: 0
#> 
#>    Plots: 5  [Parent plots: 5 Sub-plots: 0]
#> 
#>    Individual organisms: 0
#> 
#>    Organism names: 148
#> 
#>    Taxon concepts: 0
#> 
#>    Organism Identities: 148
#> 
#>    Vegetation strata: 7
#>       1. Tier 1 [1/Recce strata]
#>       2. Tier 2 [2/Recce strata]
#>       3. Tier 3 [3/Recce strata]
#>       4. Tier 4 [4/Recce strata]
#>       5. Tier 5 [5/Recce strata]
#>       6. Tier 6 [6/Recce strata]
#>       7. Tier 7 [7/Recce strata]
#> 
#>    Surface types: 0
#> 
#>    Parties: 0
#> 
#>    Literature citations: 2
#> 
#>    Methods: 2
#>       1. Recce cover scale [plant cover / 7 ordinal atts.]
#>       2. Recce strata [stratum mixed / 1 quantitative atts.]
#> 
#>    Plot observations: 5  [in parent plots: 5 in sub-plots: 0]
#> 
#>    Individual organism observations: 0
#> 
#>    Aggregated organism observations: 582
#> 
#>    Stratum observations: 33
#> 
#>    Community observations: 0
#> 
#>    Site observations: 0
#> 
#>    Surface cover observations: 0
#> 
#> ================================================================

# show plot information
showElementTable(x, "plot")
#>   plotName
#> 1   LGM38h
#> 2   LGM43h
#> 3   LGM45h
#> 4   LGM08r
#> 5   LGM16l

# show plot observation information
showElementTable(x, "plotObservation")
#>   plotName obsStartDate
#> 1   LGM38h   2011-02-20
#> 2   LGM43h   2011-02-13
#> 3   LGM45h   2011-02-11
#> 4   LGM08r   2011-02-17
#> 5   LGM16l   2011-02-15

# show methods, attributes, citations
showElementTable(x, "method")
#>                name                           description       subject
#> 1 Recce cover scale Recce recording method by Hurst/Allen   plant cover
#> 2      Recce strata     Standard Recce stratum definition stratum mixed
#>   attributeType attributeNumber
#> 1       ordinal               7
#> 2  quantitative               1
showElementTable(x, "attribute")
#> $quantitative
#>     methodName methodSubject unit lowerLimit upperLimit
#> 8 Recce strata stratum mixed    m          0        Inf
#> 
#> $ordinal
#>          methodName methodSubject code definition order lowerLimit upperLimit
#> 1 Recce cover scale   plant cover    P   Presence     1         NA         NA
#> 2 Recce cover scale   plant cover    1        <1%     2          0          1
#> 3 Recce cover scale   plant cover    2       1-5%     3          1          5
#> 4 Recce cover scale   plant cover    3      6-25%     4          5         25
#> 5 Recce cover scale   plant cover    4     26-50%     5         25         50
#> 6 Recce cover scale   plant cover    5     51-75%     6         50         75
#> 7 Recce cover scale   plant cover    6    76-100%     7         75        100
#>   midPoint
#> 1       NA
#> 2     0.05
#> 3     0.50
#> 4    15.00
#> 5    37.50
#> 6    62.50
#> 7    87.50
#> 
#> $qualitative
#> data frame with 0 columns and 0 rows
#> 
showElementTable(x, "literatureCitation")
#>                   citationString DOI
#> 1 Hurst, JM and Allen, RB. (2...  NA
#> 2 Hurst, JM and Allen, RB. (2...  NA

# show aggregate organism observations (only some of them)
head(showElementTable(x, "aggregateOrganismObservation"))
#>   plotName obsStartDate  organismIdentityName stratumName      agg_1_method
#> 1   LGM38h   2011-02-20 Dacrydium cupressinum      Tier 1 Recce cover scale
#> 2   LGM38h   2011-02-20 Dacrydium cupressinum      Tier 2 Recce cover scale
#> 3   LGM38h   2011-02-20 Dacrydium cupressinum      Tier 6 Recce cover scale
#> 4   LGM38h   2011-02-20   Weinmannia racemosa      Tier 2 Recce cover scale
#> 5   LGM38h   2011-02-20   Weinmannia racemosa      Tier 3 Recce cover scale
#> 6   LGM38h   2011-02-20   Weinmannia racemosa      Tier 4 Recce cover scale
#>   agg_1_value
#> 1           3
#> 2           3
#> 3           1
#> 4           3
#> 5           4
#> 6           3