convertToDate: Convert from excel date number to R Date type

Description Usage Arguments Details See Also Examples

View source: R/wrappers.R

Description

Convert from excel date number to R Date type

Usage

1
convertToDate(x, origin = "1900-01-01", ...)

Arguments

x

A vector of integers

origin

date. Default value is for Windows Excel 2010

...

additional parameters passed to as.Date()

Details

Excel stores dates as number of days from some origin day

See Also

writeData

Examples

1
2
3
##2014 April 21st to 25th
convertToDate(c(41750, 41751, 41752, 41753, 41754, NA) )
convertToDate(c(41750.2, 41751.99, NA, 41753 ))

Example output

[1] "2014-04-21" "2014-04-22" "2014-04-23" "2014-04-24" "2014-04-25"
[6] NA          
[1] "2014-04-21" "2014-04-22" NA           "2014-04-24"

openxlsx documentation built on May 30, 2017, 5:37 a.m.

Search within the openxlsx package
Search all R packages, documentation and source code