Learn R Programming

gatoRs (version 1.0.0)

fix_columns: Used in gators_download() - Fill out taxonomic name columns

Description

The fix_columns() function fills out the taxonomic name columns based on available information in the data set. For example, if a row has a name provided for the scientificName column, this information will be used to generate the respective genus, specificEpithet, and infraspecificEpithet columns for that row.

Usage

fix_columns(
  df,
  scientific.name = "scientificName",
  genus = "genus",
  species = "specificEpithet",
  infraspecific.epithet = "infraspecificEpithet"
)

Value

Returns the original data frame with the specified columns.

Arguments

df

Data frame of occurrence records.

scientific.name

Default = "scientificName". The name of the scientific name column in the data frame.

genus

Default = "genus". The name of the genus column in the data frame.

species

Default = "specificEpithet". The name of the specific epithet column in the data frame.

infraspecific.epithet

Default = "infraspecificEpithet". The name of the infraspecific epithet column in the data frame.

Details

This function requires package stringr.

Examples

Run this code
fixed_data <- fix_columns(data)

Run the code above in your browser using DataLab