Learn R Programming

Stack (version 2.0-1)

ensureDate: Ensure that x is a Date

Description

Ensure that x is a Date

Usage

ensureDate(x, origin = "1970-01-01", dates = NULL)

Arguments

x
Date, fac, chr, num, data.frame, or list that might be or contain something that should be a Date
origin
for Dates that may have lost their attributes, and coerced to integer, the origin for reasserting their Date-ness. default=1970-01-01
dates
for data.frame method, columns of x that should themselves be ensureDates

Value

x encoded as a Date unless all of x is numbers less than 1000, for datamart numeric survey coding.