Learn R Programming

nprcgenekeepr (version 3.0.0)

convertAncestry: Convert ancestry information to a standard code

Description

Part of Pedigree Curation

Usage

convertAncestry(ancestry)

Value

A factor vector of standardized designators specifying if an animal is a Chinese rhesus, Indian rhesus, Chinese-Indian hybrid rhesus, or Japanese macaque. Levels: CHINESE, INDIAN, HYBRID, JAPANESE, OTHER, UNKNOWN.

Arguments

ancestry

character vector or NA with free-form text providing information about the geographic population of origin. Matching ignores case and looks for text inside each value: a value containing "chin" but not "ind" is CHINESE, one containing "ind" but not "chin" is INDIAN, one containing both, or "hyb", is HYBRID, and one containing "jap" is JAPANESE. NA is UNKNOWN and anything else is OTHER. For example, "Indonesian" is INDIAN.

Examples

Run this code
original <- c("china", "india", "hybridized", NA, "human", "gorilla")
convertAncestry(original)

Run the code above in your browser using DataLab