# NOT RUN {
x <- date_yq(2016, 2)
get_year(x)
# }
# NOT RUN {
library(lubridate)
year(x)
# }
# NOT RUN {
x <- date_yq(2016, 2)
get_quarter(x)
# }
# NOT RUN {
library(lubridate)
quarter(x)
# }
# NOT RUN {
x <- date_yq(2016, 2)
get_month(x)
# }
# NOT RUN {
library(lubridate)
month(x)
# }
# NOT RUN {
x <- date_yw(2016, 2)
get_isoweek(x)
get_isoyear(as.Date("2018-01-01"))
get_isoyear(as.Date("2016-01-01"))
# }
Run the code above in your browser using DataLab