Learn R Programming

madshapR (version 2.0.0)

as_taxonomy: Validate and coerce any object as a taxonomy

Description

Confirms that the input object is a valid taxonomy and returns it as a taxonomy with the appropriate madshapR::class attribute. This function mainly helps validate input within other functions of the package but could be used to check if a taxonomy is valid.

Usage

as_taxonomy(object)

Value

A list of data frame(s) with madshapR::class 'taxonomy'.

Arguments

object

A potential taxonomy to be coerced.

Details

A taxonomy is a classification schema that can be defined for variable attributes. A taxonomy is usually extracted from an Opal environment, and a taxonomy object is a data frame that must contain at least the columns taxonomy, vocabulary, and terms. Additional details about Opal taxonomies are available online.

See Also

Examples

Run this code
{

# use madshapR_examples provided by the package
taxonomy <- as_taxonomy(madshapR_examples$`taxonomy_example`)
head(taxonomy)

}

Run the code above in your browser using DataLab