taxonomy: Taxonomy based cleaning

taxonomyR Documentation

Taxonomy based cleaning

Description

Taxonomy based cleaning

Usage

tax_no_epithet(x, name = NULL, drop = TRUE)

Arguments

x

(data.frame) A data.frame1

name

(character) Taxonomic name field Optional. See Details.

drop

(logical) Drop bad data points or not. Either way, we parse out bade data points as an attribute you can access. Default: TRUE

Value

Returns a data.frame, with attributes

Examples

if (requireNamespace("rgbif", quietly = TRUE) && interactive()) {
   library("rgbif")
   res <- rgbif::occ_data(limit = 200)$data
} else {
   res <- sample_data_3
}

# Remove records where names don't have genus + epithet
## so removes those with only genus and those with no name (NA or NULL)
NROW(res)
df <- dframe(res) %>% tax_no_epithet(name = "name")
NROW(df)
attr(df, "name_var")
attr(df, "tax_no_epithet")

ropensci/scrubr documentation built on Sept. 12, 2022, 2:12 p.m.