Learn R Programming

scrubr (version 0.4.0)

taxonomy: 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

Run this code
# NOT RUN {
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")
# }

Run the code above in your browser using DataLab