如何在R中将字符串转换为Date
问题描述:
有什么方法可以将下面的字符串转换为标准的R date类对象?
Is there any way to convert below string to a standard R date class object?
Date_String = "19th January 2020"
任何指针都表示赞赏.
答
Lubridate可以处理它:
Lubridate can handle it:
> Date_String <- "19th January 2020"
> lubridate::dmy(Date_String)
[1] "2020-01-19"