check_date_updated: Check Update Date in Data for Regions REDcap Project

View source: R/download_generic.R

check_date_updatedR Documentation

Check Update Date in Data for Regions REDcap Project

Description

check_date_updated() checks whether the supplied date (today, by default) matches the date_updated record for the specified region in the Data for Regions REDcap project.

Usage

check_date_updated(
  date = Sys.Date(),
  api_token = Sys.getenv("redcap_DFR_token"),
  region = "MSR",
  date_updated = "date_updated",
  quiet = FALSE,
  vac = FALSE
)

Arguments

date

The date to check against; defaults to Sys.Date(), which is probably what you want

api_token

The API token for accessing the Data for Regions REDcap project. This should be stored in an .Renviron file; see env_vars for details.

region

The region to check for; exists to aid internal implementation and should probably not be changed from default

date_updated

The name of the record containing the date updated in REDcap; this exists to aid internal implementation and should probably not be changed from default

quiet

By default, warnings are issued if date does not match, and a message is issued if it does; should these be silenced?

vac

Should vaccination data be checked (TRUE), or NBS data (FALSE, the default)?

Value

TRUE if dates match, FALSE otherwise

See Also

data-for-regions-snapshots


jesse-smith/coviData documentation built on Jan. 14, 2023, 11:08 a.m.