days: Return Various Periods from a Chron or Dates Object
Description
Given a chron or dates object, extract the year, quarter, month, day
(within the month) or weekday (days within the week) of the date it
represents.Usage
days(x)
## S3 method for class 'default':
weekdays(x, abb = TRUE)
## S3 method for class 'default':
months(x, abb = TRUE)
## S3 method for class 'default':
quarters(x, abb = TRUE)
years(x)
Arguments
abb
should abbreviated names be returned? Default is TRUE
.
Value
- an ordered factor corresponding to days, weekdays, months, quarters,
or years of
x
for the respective function.
Examples
Run this codedts <- dates("07/01/78") + trunc(50 * rnorm(30))
plot(weekdays(dts))
plot(months(dts))
Run the code above in your browser using DataCamp Workspace