pct_cover | R Documentation |
Calculate the percent cover by plot for variables or combinations of variables. Percent cover will be calculated for every combination of the variables requested, so if the variables are GrowthHabitSub
and Duration
then the output will contain fields like Graminoid.Perennial
, Graminoid.Annual
, Shrub.Perennial
, etc. whereas using just the variable code
will produce one column per species code. Any number of indicator variables can be used. These are calculated as cover from anywhere in the canopy column or as only the first hit in the canopy column. Any groupings where all the variable values were NA
will be dropped.
pct_cover(lpi_tall, tall = FALSE, hit = "any", by_line = FALSE, ...)
lpi_tall |
A tall/long-format data frame. Use the data frame |
tall |
Logical. If |
hit |
Character string. If |
by_line |
Logical. If |
... |
Optional character strings. One or more variable name from |
# Gather header and LPI files
dsn = "Path/To/LMF_Geodatabase.gdb" # also contains species list
header <- gather_header(dsn = dsn,
source = "LMF")
lpi_tall <- gather_lpi(dsn = "Path/To/LMF_Geodatabase.gdb",
source = "LMF")
# Join lpi_tall and header to get the SpeciesState value associated with LPI data
lpi_tall <- dplyr::left_join(lpi_tall, header)
# Join species list attributes
species_join(data = lpi_tall,species_file = dsn)
# Calculate percent cover of individual species and cover values (S, R, etc) in lpi_tall
pct_cover(lpi_tall = lpi_tall,
tall = FALSE,
hit = "any",
by_line = FALSE,
code)
Calculate percent cover of Duration and Growth Habit Sub (e.g., to produce Annual Forb cover)
pct_cover(lpi_tall = lpi_tall,
tall = FALSE,
hit = "any",
by_line = FALSE,
Duration, GrowthHabitSub)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.