View source: R/accepted_entries.R
accepted_entries | R Documentation |
accepted_entries
takes a data frame of user-entered plant species and returns
a data frame of plant species that are successfully matched to the regional FQA
database of choice. Regional databases are stored in the fqadata
R package.
accepted_entries
is a utility function that is used in all other metric-calculating
functions in this package.
accepted_entries(
x,
key = "name",
db,
native = c(TRUE, FALSE),
wetland_warning = TRUE,
cover_weighted = FALSE,
cover_class = "percent_cover",
allow_duplicates = FALSE,
allow_no_c = FALSE,
allow_non_veg = FALSE,
plot_id = NULL
)
x |
A data frame containing a list of plant species. This data frame
must have one of the following columns: |
key |
A character string representing the column that will be used to join
the input data frame |
db |
A character string representing the regional FQA database to use. See
|
native |
Boolean (TRUE or FALSE). If TRUE, calculate metrics using only native species. |
wetland_warning |
Boolean (TRUE or FALSE). If TRUE, show user messages regarding issues with wetness coefficients. |
cover_weighted |
Boolean (TRUE or FALSE). If TRUE, keep |
cover_class |
a character string representing the cover classification used. Acceptable
cover classes are: |
allow_duplicates |
Boolean (TRUE or FALSE). If TRUE, allow |
allow_no_c |
Boolean (TRUE or FALSE). If TRUE, allow species that are found in the regional FQA database but have not been assigned a C Values. If FALSE, omit species that have not been assigned C Values. |
allow_non_veg |
Boolean (TRUE or FALSE). If TRUE, allow input to contain un-vegetated ground and un-vegetated water. |
plot_id |
A character string representing the column in |
A data frame containing the key
column–either acronym
or
name
–as well as columns from the relevant FQA database.
These columns include name_origin
accepted_name
, family
, nativity
, c
(which represents the C Value),
w
(which represents wetness score), physiognomy
, duration
, and common_name
plant_list <- crooked_island
#with native and introduced species
accepted_entries(x = plant_list, key = "acronym", db = "michigan_2014", native = FALSE)
#with only native species
accepted_entries(x = plant_list, key = "acronym", db = "michigan_2014", native = TRUE)
#an example with duplicates allowed
duplicate_df <- data.frame(acronym = c("ABEESC", "ABIBAL", "ABIBAL"),
cover = c(60, 50, 50))
accepted_entries(x = duplicate_df, key = "acronym",
db = "michigan_2014", native = FALSE, allow_duplicates = TRUE)
#an example of duplicates not allowed
accepted_entries(x = duplicate_df, key = "acronym",
db = "michigan_2014", native = FALSE, allow_duplicates = FALSE)
#an example of duplicates not allowed, adding cover values
accepted_entries(x = duplicate_df, key = "acronym",
db = "michigan_2014", native = FALSE, allow_duplicates = FALSE,
cover_weighted = TRUE)
#an example where some entries are synonyms shared by more than one species
same_syn <- data.frame(name = c("CAREX MURICATA", "POTENTILLA NANA", "ABIES BIFOLIA"),
cover = c(80, 60, 10))
#produces a warning saying CAREX MURICATA is a synonym to multiple species and will be omitted.
#To include this species, use the accepted scientific name.
accepted_entries(x = same_syn, key = "name",
db = "wyoming_2017", native = FALSE)
#an example where species is both a synonym and an accepted name
same_syn2 <- data.frame(name = c("CAREX FOENEA", "ABIES BIFOLIA"),
cover = c(80, 10))
#produces a warning saying CAREX FOENEA is an accepted scientific name and a synonym.
#It will default to accepted scientific name.
accepted_entries(x = same_syn2, key = "name",
db = "wyoming_2017", native = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.