【发布时间】:2015-10-09 23:28:53
【问题描述】:
我的 R 脚本读取两列的 CSV 数据,其中列是时间戳和标量值,其中:
data = read.csv(dataFilePath, colClasses=c("charDate", "numeric"))
我的时间戳被格式化,例如“5/14/14 13:14”。 charDate 类被定义为转换时间戳:
setClass("charDate")
setAs("character", "charDate", function(from) strftime(from))
我正在运行的数据文件是here。它们都按预期读入,在 R 数据帧data 中表示为例如“2014-05-14 13:14:00”,realTweets/ 目录中的除外。为什么?对于 realTweets/,data 中的时间戳看起来像例如“2014-05-14”,时间信息未保存。
【问题讨论】:
-
@RichardScriven 运行上述代码后时间被删除。