更大的数据帧错误'不知道如何将'df $ V3'转换为类“POSIXct”'

时间:2016-05-01 10:28:18

标签: r biginsights bigr

我正在尝试用bigr创建一个计算列。首先加载数据:

@Test
public void testMethod() {
    TargetClass targetClass = new TargetClass();
    AtomicBoolean success = new AtomicBoolean();
    synchronized (success) {
        targetClass.executeMethod(
            list, 
            result -> {
                synchronized (success) {
                    success.set(true);
                    success.notify();
                } 
            }, 
            error -> {
                synchronized (success) {
                    success.set(false);
                    success.notify();
                } 
            }
        );
        success.wait();
    }
    // The rest of your unit test here
}

然后尝试添加一列:

> 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”

V3列中的值如下所示:

> class(df$V3)
[1] "bigr.vector"
attr(,"package")
[1] "bigr"

我不知道该怎么办 - 任何提示?

更新:

我尝试过转换为角色:

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")

0 个答案:

没有答案