valid_dates | R Documentation |
This function validates that there are no gaps or overlaps between dates specified in the "seed_date" and "signal_date". During plausibility component analyses, the function is called to validate the seed against the evaluated signal.
valid_dates(seed_date, signal_date, resolution, warn_incomplete = FALSE)
seed_date |
Last date available in seed object |
signal_date |
First date available in signal object |
resolution |
Character vector specifying the temporal resolution (e.g., "days", "weeks", "months") |
warn_incomplete |
Logical as to whether or not the validation should warn for completeness of seed and signal; default is |
The validation will return with a stop()
if there is an overlap or gap between seed and signal dates. Otherwise the function will invisibly return TRUE
indicating that the date span is valid.
seed_date <- as.Date("2023-03-08")
signal_date <- as.Date("2023-03-15")
valid_dates(seed_date = seed_date, signal_date = signal_date, resolution="weeks")
x <- try(valid_dates(seed_date = seed_date,
signal_date = signal_date,
resolution="days"), silent=TRUE)
x
x <- try(valid_dates(seed_date = seed_date,
signal_date = signal_date,
resolution="months"), silent=TRUE)
x
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.