Learn R Programming

nprcgenekeepr (version 3.0.0)

convertFromCenter: Convert from-center information to a logical value

Description

Part of Pedigree Curation

Usage

convertFromCenter(fromCenter)

Value

A logical vector specifying TRUE if an animal is from the center otherwise FALSE. An NA input stays NA. A value is read only when the whole text, ignoring case and any spaces around it, is y, yes, t or true (TRUE), or n, no, f or false (FALSE). Any other value, such as "unknown", "maybe", a number such as 1L or an empty string, stops with an error naming the offending rows.

Arguments

fromCenter

character or logical vector or NA indicating whether or not the animal is from the center.

Examples

Run this code
original <- c(
  "y", "yes", "Y", "Yes", "YES", "n", "N", "No", "NO", "no",
  "t", "T", "True", "true", "TRUE", "f", "F", "false", "False",
  "FALSE"
)
convertFromCenter(original)

Run the code above in your browser using DataLab