Learn R Programming

fossilbrush (version 1.0.6)

add_kingdoms: add_kingdoms

Description

Convenience function to add in a kingdom column to a PBDB dataset. This relies on the dataset having a column of phylum-level assignments for occurrences. The kingdom column is a useful addition for filtering very large taxonomically diverse datasets, and adds in an additional level of data which can inform taxonomic cleaning routines like those called by @seealso check_taxonomy

Usage

add_kingdoms(x, phylum = "phylum", insert.left = TRUE)

Value

The dataframe x, with the kingdom column inserted

Arguments

x

A dataframe containing, minimally, phylum-level assignments of the data

phylum

A character of length 1 specifing the column in x with the phylum level assignments

insert.left

A convenience argument which will make sure that the kingdom column will be inserted in dataframe left immediately to the left of the phylum column

Examples

Run this code
# load dataset
data("brachios")
# add kingdoms to dataset
brachios <- add_kingdoms(brachios)

Run the code above in your browser using DataLab