使用readr在日期和月份中没有前导零的情况下使用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
任何帮助,将不胜感激
你可能会从调用read.csv2之前定义自己的日期格式中受益。看到这篇文章:[在read.table/read.csv中为colClasses参数指定自定义日期格式](http://stackoverflow.com/questions/13022299/specify-custom-date-format-for-colclasses-argument-in-读表读CSV)。 –