Learn R Programming

nprcgenekeepr (version 3.0.0)

removeUnknownAnimals: Remove placeholder animals added for unknown parents

Description

Remove placeholder animals added for unknown parents

Usage

removeUnknownAnimals(ped)

Value

Pedigree with the animals whose recordStatus is "added" removed. Every other animal is kept, including one whose recordStatus is missing (NA) or has any other value. A pedigree without a recordStatus column has no animals marked as added, so it is returned unchanged.

Arguments

ped

The pedigree information in data.frame format

Examples

Run this code
library(nprcgenekeepr)
ped <- nprcgenekeepr::smallPed
addedPed <- cbind(ped,
  recordStatus = rep("original", nrow(ped)),
  stringsAsFactors = FALSE
)
addedPed[1:3, "recordStatus"] <- "added"
ped2 <- removeUnknownAnimals(addedPed)
nrow(ped)
nrow(ped2)

Run the code above in your browser using DataLab