【发布时间】:2021-10-08 21:08:52
【问题描述】:
我尝试将日期变量从因子格式更改为日期格式,但我不能,我也不知道为什么。
这是我的代码
temp_tot <-read.csv("temp_total_030820.csv",header=TRUE,sep=",",na.strings=".", stringsAsFactors=FALSE)
class(temp_tot$date)#character
temp_tot$date<-as.Date(temp_tot$date,format="%m/%d/%y")#returning N.A
这是我的数据输出
structure(list(X = 1L, capteur = "30-01-s.", Year = 2021L, jj = 1L,
variable = "tmax", value = 0.517166666666667, dpt = "Aigoual",
pos = "sol", date = "2021-01-01"), row.names = 1L, class = "data.frame")
我尝试了很多功能,但我不知道我卡在哪里了。跟“Locale”有关系吗?
谢谢!
【问题讨论】: