【发布时间】:2020-09-04 18:08:29
【问题描述】:
我不知道我的日期数据有什么问题。 housing_data数据框中Date列的示例如下:
"February 2012" "March 2012" "April 2012" "May 2013" "July 2015" "March 2016"
"May 2016" "April 2017" "July 2017" "October 2017" "December 2017" "February 2018"
我运行housing_data$Date <- base::as.Date(housing_data$Date, "%B %Y"),除了NA 什么都没有返回,就好像我的格式不正确一样。我错过了什么?
【问题讨论】:
-
Date需要一天时间:Converting year and month (“yyyy-mm” format) to a date?。此外,%B对区域设置敏感,可能是个问题:strptime, as.POSIXct and as.Date return unexpected NA
标签: r macos date formatting