Description Usage Arguments Details Functions Examples
Formatting function for date-time data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | as.Date0(date)
MonthFromDate(date)
FirstDayOfMonth(date)
YearFromDate(date)
DateAsDateTime(date)
DOW(date)
HourFromDateTime(datetime)
DateFromDateTime(datetime)
DateAndHEAsPOSIX(date, HE)
|
date |
Date in either 'character' or 'date' format. |
datetime |
date-time in 'POSIXct' format. |
HE |
Integer (1:24) indicating hour-ending. |
DateFromDateTime is different from simply using as.Date(date-time), because date-time is stored in standard time with time zone in R.
MonthFromDate
: Given a date, rerurn the month as numeric
FirstDayOfMonth
: Given a date, returns the first day of the month
YearFromDate
: Given a date, rerurn the year as numeric
DateAsDateTime
: Given a date, returns 12:00am of the date in POSIXct format
DOW
: Day of week from a date
HourFromDateTime
: Given a date-time, return the hour as numeric
DateFromDateTime
: Given a date-time, returns a date.
DateAndHEAsPOSIX
: Given a date and HE, returns the date-time for the beginning of the hour.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | as.Date0("1/1/2000")
as.Date1("1/1/2000"); as.Date1("2000-1-1")
dates <- seq(as.Date("2000-1-1"), length.out = 6, by="mon")+15
dates
MonthFromDate(dates)
FirstDayOfMonth(dates)
YearFromDate(dates)
DOW(dates)
DateAndHEAsPOSIX(dates, c(1:10))
datetimes <- DateAsDateTime(dates)+8*60*60
datetimes
HourFromDateTime(datetimes)
DateFromDateTime(datetimes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.