cs_validate | R Documentation |
Data from SLMPD are released with a number of problems that
cs_validate
is designed to identify.
cs_validate(.data, year, verbose = FALSE)
.data |
A tbl |
year |
A string representing the year being checked, e.g. |
verbose |
A logical scalar. If |
cs_validate
performs a total of five checks on the given
year-list object. Each test is summarized in the verbose = TRUE
output:
Each tibble within a year-list is named for the month it represents. Does the named month match the month that the data represent?
Does the year provided for the year
argument match the year
that the data represent?
Does each tibble represent only one month of data?
Does each tibble have the correct number of variables (20)?
Does each tibble have the correct variable names?
For all months prior to 2013 and approximately half of the months during 2013,
SLMPD data are released with 18 variables. For one month, May 2017, the data
are released with 26 variables. These problems are identified most easily
by using cs_validate
.
A tibble with validation results.
# load example year-list object
load(system.file("testdata", "yearList17.rda", package = "compstatr", mustWork = TRUE))
# simple validation
cs_validate(yearList17, year = 2017)
# verbose validation
cs_validate(yearList17, year = 2017, verbose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.