Description Usage Arguments Details Value See Also Examples
Parse Excel Numeric Date/Time
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | p_excel_dt(x)
## Default S3 method:
p_excel_dt(x)
## S3 method for class 'numeric'
p_excel_dt(x)
## S3 method for class 'Date'
p_excel_dt(x)
## S3 method for class 'POSIXct'
p_excel_dt(x)
## S3 method for class 'character'
p_excel_dt(x)
|
x |
numeric; vector of Excel date/times expressed as numeric |
At times readxl::read_excel does not get the date and times right and imports them as numeric instead. This converts those numeric date/times to proper Date or POSIXct objects.
A Date object if x
is integer; a POSIXct object if x
is
numeric.
1 2 3 4 5 6 7 8 | p_excel_dt( 40000 )
p_excel_dt( c(40000,NA))
p_excel_dt( Sys.Date() )
p_excel_dt( Sys.time() )
p_excel_dt( c("12/1/2016 12:01 PM") )
p_excel_dt( c("12/1/2016 12:01 PM", "12/1/2016", NA, "Unparsable", "4365") )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.