我正在尝试创建一个更大的计算列。首先加载数据:
> df <- bigr.frame (dataPath = "/data.csv",
dataSource="DEL", delimiter=",", header=F,
coltypes = c("integer", "character", "character"))
然后尝试添加一列:
> df$posixct = as.POSIXct(df$V3, tz="UTC", format="%Y-%m-%d %H:%M:%S")
但是,我收到错误消息:
Error in as.POSIXct.default(df$V3, tz = "UTC", format = "%Y-%m-%d %H:%M:%S") :
do not know how to convert 'df$V3' to class “POSIXct”
我看了一下课程:
> class(df$V3)
[1] "bigr.vector"
attr(,"package")
[1] "bigr"
V3 列中的值如下所示:
2005-01-01 00:00:00
2005-01-01 00:10:00
...
我不确定如何进行 - 有什么提示吗?
更新:
我试过转换成一个字符:
> df$posixct = as.POSIXct(
as.character(df$V3), tz="UTC", format="%Y-%m-%d %H:%M:%S")
但是收到以下错误
Error in as.POSIXct.default(as.character(df$V3), tz = "UTC", format = "%Y-%m-%d %H:%M:%S") :
do not know how to convert 'as.character(df$V3)' to class “POSIXct”