-1
嗨我是R新手,我試圖在日期列的數據框中更改日期格式。我的日期欄格式爲Mar 13 2007 01:05:123AM
。現在這個日期格式的值是相同的,除了日變化和時間保持不變。所以我想改變格式爲Mar 13 2007
。我試了下面的代碼在R中使用as更改日期格式
df <- read.csv("mydata.csv")
df$collectdate <- format(as.Date(df$collectdate,"%b %d %Y"))
但它給錯誤character string is not in a standard unambiguous format
。請提前指導感謝。
它看起來像誤差爲R沒有認識到是什麼格式的日期列。 – hwnd 2014-09-13 08:27:25
@ user449355最好是使用'dput'即發佈了一些示例數據。 'dput(head(df,10))' – akrun 2014-09-13 08:32:01
你的語言環境是什麼? – Roland 2014-09-13 09:11:24