make.Date: Convert a vector to a date object

Description Usage Arguments Value See Also Examples

View source: R/write32.dta.R

Description

Checks if all data can be converted to Date and forces any "" to be NA

Usage

1
make.Date(x, format = "%d-%b-%Y")

Arguments

x

vector of character or factor classes

format

date format to be passed to as.POSIXct, default to '%d-%b-%Y'

Value

Date vector or vector of class passed in

See Also

write32.dta, as.Date

Examples

1
2
3
4
5
6
x <- c("1", "2", "50.5")
make.Date(x)
x = c("01-Jan-2014", NA, "01-01-2014")
make.Date(x)
x = c("01-Jan-2014", NA)
make.Date(x)

muschellij2/processVISION documentation built on May 23, 2019, 9:54 a.m.