View source: R/checkRequiredCols.R
| checkRequiredCols | R Documentation |
Check column names for required columns
checkRequiredCols(cols, reportErrors)
cols |
character vector of column names |
reportErrors |
logical value when |
When reportErrors = TRUE, NA entries in cols
are treated as ordinary non-matching column names when building the list of
missing required columns, rather than causing an error. (Earlier versions
could error with "missing value where TRUE/FALSE needed" on such
out-of-contract input.)
NULL is returned if all required columns are present. See description
of reportErrors for return values when required columns are missing.
library(nprcgenekeepr)
requiredCols <- getRequiredCols()
cols <-
paste0(
"id,sire,siretype,dam,damtype,sex,numberofparentsknown,birth,",
"arrivalatcenter,death,departure,status,ancestry,fromcenter?,",
"origin"
)
all(requiredCols %in% checkRequiredCols(cols, reportErrors = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.