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

View source: R/getDateErrorsAndConvertDatesInPed.R

getDateErrorsAndConvertDatesInPedR Documentation

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.

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.

Value

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

Examples

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

rmsharp/nprcmanager documentation built on Feb. 2, 2025, 12:45 a.m.