View source: R/datetime_utils.R
month | R Documentation |
Extract numeric months of the year from a Date, POSIXct or POSIXlt vector.
month(x, string = TRUE, abbreviate = FALSE)
x |
Date, POSIXct or POSIXlt vector |
string |
Logical, if TRUE months string is returned, otherwise numeric |
abbreviate |
logical. Should the months in string format be abbreviated? |
A vector with extracted months.
Sys.Date()
month(Sys.Date())
month(Sys.Date(), string = FALSE)
month(Sys.Date(), string = TRUE, abbreviate = TRUE)
## from base package
month(Sys.Date())
month(as.POSIXct(Sys.Date()))
month(as.POSIXlt(Sys.Date()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.