cs_validate: Validate Year List Object

View source: R/validate.R

cs_validateR Documentation

Validate Year List Object

Description

Data from SLMPD are released with a number of problems that cs_validate is designed to identify.

Usage

cs_validate(.data, year, verbose = FALSE)

Arguments

.data

A tbl

year

A string representing the year being checked, e.g. "2008"

verbose

A logical scalar. If TRUE, a full validation report summarizing results will be returned. If FALSE, a single value will be returned.

Details

cs_validate performs a total of five checks on the given year-list object. Each test is summarized in the verbose = TRUE output:

valMonth

Each tibble within a year-list is named for the month it represents. Does the named month match the month that the data represent?

valYear

Does the year provided for the year argument match the year that the data represent?

oneMonth

Does each tibble represent only one month of data?

varCount

Does each tibble have the correct number of variables (20)?

valVars

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.

Value

A tibble with validation results.

Examples

# 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)


chris-prener/compStatR documentation built on Jan. 25, 2024, 10:03 p.m.