Data from SLMPD are released with a number of problems that
cs_validate_year is designed to identify.
cs_validate_year(.data, year, verbose)
| .data | A tbl |
|---|---|
| year | A string representing the year being checked, e.g. |
| verbose | A logical scalar. If |
A tibble with validation results
Since the data are imported alphabetically, cs_validate_year
checks to ensure that items are imported in the correct order. It also
checks each month to make sure it contains only one month worth of data.
After ensuring that months are being read correctly, the function also
counts the number of variables in each object. 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. Finally, it makes sure that all variables are being
imported with the correct formatting.