date_check: Date checks

Description Usage Arguments

View source: R/import_date_check.R

Description

Function looks for dates out of the expected range, possible swapped months and dates, or if dates are in the future

Usage

1
2
3
4
5
6
7
8
date_check(
  df,
  col,
  check_future = T,
  date_blacklist = as.Date(c("1899-12-31", "1900-01-01", "1901-01-01", "1904-01-02",
    "9999-09-09")),
  valid_date_range = c(1970, 2050)
)

Arguments

df

pass in data frame

col

pass in a column name

check_future

whether to return warnings for dates in the future (default is true)

date_blacklist

a list of dates which we don't interpret as valid

valid_date_range

list of two years, between which dates should be interpreted as valid


associatedpress/apdatacheck documentation built on Feb. 17, 2020, 9:27 p.m.