Learn R Programming

paleoDiv (version 0.4.6)

occ.cleanup: Clean up occurrence dataset by removing commonly used character combinations in the identified name that will result in different factor levels for the same taxon.

Description

Clean up occurrence dataset by removing commonly used character combinations in the identified name that will result in different factor levels for the same taxon.

Usage

occ.cleanup(x, remove = NULL, return.df = FALSE)

Value

A character vector containing the cleaned up taxonomic names or a dataframe with cleaned-up tna column (if return.df==TRUE).

Arguments

x

A occurrence data.frame or character vector containing the variable to clean up (defaults to x$tna)

remove

Which values to remove. If NULL, a default set of commonly occurring character combinations is used ("n. gen.", "n. sp.", "cf.","aff.", punctuation, as well as double, leading and ending spaces). If user-defined, remove needs to be formatted as a character vector with the values to be removed as names, i.e. in the format of c("remove_this" = "", "removethistoo"="")

return.df

A logical indicating whether to return the entire data.frame (if TRUE) or just the column of taxonomic names.

Examples

Run this code
data(archosauria)
occ.cleanup(archosauria$Stegosauria)->archosauria$Stegosauria

Run the code above in your browser using DataLab