Last chance! 50% off unlimited learning
Sale ends in
what_month
provides a satisficing version of
to determine the month corresponding to a given date.
what_month(when = Sys.time(), abbr = FALSE, as_integer = FALSE)
Date (as a scalar or vector).
Default: when = NA
.
Using as.Date(when)
to convert strings into dates,
and Sys.Date()
, if when = NA
.
Boolean: Return abbreviated?
Default: abbr = FALSE
.
Boolean: Return as integer?
Default: as_integer = FALSE
.
what_month
returns the month
of when
or Sys.Date()
(as a name or number).
what_week()
function to obtain weeks;
what_date()
function to obtain dates;
cur_time()
function to print the current time;
cur_date()
function to print the current date;
now()
function of the lubridate package;
Sys.time()
function of base R.
Other date and time functions:
cur_date()
,
cur_time()
,
what_date()
,
what_day()
,
what_time()
,
what_week()
,
what_year()
# NOT RUN {
what_month()
what_month(abbr = TRUE)
what_month(as_integer = TRUE)
# Work with vectors (when as characters):
ds <- c("2020-01-01", "2020-02-29", "2020-12-24", "2020-12-31")
what_month(when = ds)
what_month(when = ds, abbr = TRUE, as_integer = FALSE)
what_month(when = ds, abbr = TRUE, as_integer = TRUE)
# }
Run the code above in your browser using DataLab