View source: R/decimal-dates.r
date_decimal | R Documentation |
Converts a decimal to a date
date_decimal(decimal, tz = "UTC")
decimal |
a numeric object |
tz |
the time zone required |
a POSIXct object, whose year corresponds to the integer part of decimal. The months, days, hours, minutes and seconds elements are picked so the date-time will accurately represent the fraction of the year expressed by decimal.
date <- ymd("2009-02-10")
decimal <- decimal_date(date) # 2009.11
date_decimal(decimal) # "2009-02-10 UTC"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.