rip_month() extracts the month from a date or datetime object.
rip_month(x)
| x |
The vector to extract the month from. |
|---|
An integer vector the same size as x containing the months. 1
aligns with January, and 12 is December.
#> [1] 1# Identical dates, but in different months a <- as.POSIXct("1969-12-31 19:00:00", tz = "America/New_York") b <- as.POSIXct("1970-01-01 00:00:00", tz = "UTC") identical(as.numeric(a), as.numeric(b))#> [1] TRUErip_month(a)#> [1] 12rip_month(b)#> [1] 1