isDate: isDate will format date input to work with MySQL

Description Usage Arguments Details Value Examples

View source: R/isDate.R

Description

'isDate' will try to format an input date into a format recognizable by MySQL, i.e., YYYY-MM-DD.

Usage

1
isDate(mydate)

Arguments

mydate

string to be formated.

Details

'isDate' will format the input as YYYY-MM-DD and will generate an error if the date cannot be formatted. The year should be specified as YYYY and must be >= 1900.

Value

isDate() returns the date in the format of YYYY-MM-DD.

Examples

1
2
3
4
5
6
7
8
# This will print 2001-01-09"
isDate("2001-1-9")

## Not run: 
# This will give an error
isDate("209-01-9999")

## End(Not run)

gdancik/pmc2nc documentation built on May 5, 2019, 7:09 a.m.