Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 readr 在 R 中读取欧洲日期格式 date.month.year 时遇到问题,其中日期和月份没有前导零。例如
文件:
1 date_of_birth 2 1.2.2016
尝试过(除其他外):
file <- read_csv2("file.csv",col_types = cols( date_of_birth=col_date("%d.%m.%Y") ))
结果 date_of_birth : num 122016
任何帮助,将不胜感激
这就是你所追求的吗?
> as.Date(gsub("\\.","\\/","1.2.2016"),"%d/%m/%Y")
[1] 《2016-02-01》