Learn R Programming

nprcgenekeepr (version 1.0.5)

getDateErrorsAndConvertDatesInPed: Converts columns of dates in text form to Date object columns

Description

Finds date errors in columns defined in convertDate as dates and converts date strings to Date objects.

Usage

getDateErrorsAndConvertDatesInPed(sb, errorLst)

Arguments

sb

A dataframe containing a table of pedigree and demographic information.

errorLst

object with placeholders for error types found in a pedigree file by qcStudbook through the functions it calls.

Value

A list with the pedigree, sb, and the errorLst with invalid date rows (errorLst$invalidDateRows)

Details

If there are no errors that prevent the calculation of exit dates, they are calculated and added to the pedigree otherwise the pedigree is not updated.

Examples

Run this code
# NOT RUN {
library(nprcgenekeepr)
ped <- nprcgenekeepr::pedInvalidDates
ped
errorLst <- getEmptyErrorLst()
colNamesAndErrors <- fixColumnNames(names(ped), errorLst)
names(ped) <- colNamesAndErrors$newColNames
pedAndErrors <- getDateErrorsAndConvertDatesInPed(ped, errorLst)
pedAndErrors$sb
pedAndErrors$errorLst
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab