InCategory: Value Matching by Thesaurus Category

Description Usage Arguments Value See Also Examples

View source: R/InCategory.R

Description

Function to check if an element belongs to a category according to a thesaurus. It is similar to %in% and is.element, returning a logical vector indicating if each element in a given vector is included in a given set. But InCategory checks for equality assuming the equivalencies defined in the given thesaurus.

Usage

1
InCategory(x, category, thesaurus)

Arguments

x

Character vector to be checked for its inclusion in the category.

category

Character vector identifying the categories in which the inclusion of x will be checked. Each category can be identified by any equivalent name in the thesaurus.

thesaurus

A thesaurus object.

Value

A logical vector of the same length as x. Each value answers the question: Does the corresponding element in x belongs to any of the thesaurus categories identified by category?

See Also

zoologThesaurus, %in%

Examples

1
2
3
InCategory(c("sheep", "cattle", "goat", "red deer"),
           c("ovis", "capra"),
           zoologThesaurus$taxon)

zoolog documentation built on Sept. 5, 2021, 5:37 p.m.