Loading package
# (lubridate) library(lubridate)
The first function ymd(): parses the date as the year, month, and date format
x <- c("09-01-01", "09-01-02", "09-01-03") ymd(x)
[1] “2009-01-01” “2009-01-02” “2009-01-03”
x <- c("2009-01-01", "2009-01-02", "2009-01-03") ymd(x)
[1] “2009-01-01” “2009-01-02” “2009-01-03”
> ymd(090101, 90102)
[1] “2009-01-01” “2009-01-02”
Similar to this function are ydm(), mdy(), mdy(), myd(), dmy(), dym(),
Note: The three English letters ymd here represent year, month, and day respectively. The different letter arrangements above mean that the date is parsed in different formats.
The year, month and day of the extraction dates
mday((“2015-11-20”))
[1] 20
wday((“2015-11-20”))
[1] 6
hour((“2015-11-20 01:30:00”))
[1] 1
minute((“2015-11-20 01:30:00”))
[1] 30
This is the end of this article about the processing time data of the R language lubridate package. For more related content of the R language lubridate package, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!