check_date: Function to check the validity of date inputs

Description Usage Arguments Value Examples

Description

Function to check the validity of date inputs

Usage

1
check_date(x, future_warning = FALSE)

Arguments

x

Date; a length 1 Date or a string expressed in a standard unambiguous format. Descriptive errors are produced for numeric inputs or invalid string formats.

future_warning

logical; When TRUE, a warning message is produced if the supplied date is greater than current date + 1 day.

Value

When no errors are triggered, check_date returns a valid Date object equal to the input.

Examples

1
2
3
4
5
6
7
## Not run: 
check_date(3)
Error in check_date(3) :
'3' is an invalid date selection of class 'numeric'.
You must supply a valid date object or a character of form 'YYYY-MM-DD'!

## End(Not run)

sevenpark/AvenueAPI-R documentation built on May 13, 2019, 4:10 a.m.