1

如果我运行此代码:

myData <- rxDataStep(inData=SensorData, varsToKeep=c("X.U.FEFF.time"),
    rowSelection=floor(as.numeric(X.U.FEFF.time)) ==
                     floor(as.numeric(as.POSIXct("2016-08-29 19:16:10",tz="GMT"))))

这对我来说可以。

但是,如果我将代码更改为:

WarnungZeit <- as.POSIXct("2016-08-29 19:16:10",tz="GMT")
WarnungZeit <- WarnungZeit + Test1[1,]$Diff_Warnung

myData <- rxDataStep(inData=SensorData, varsToKeep=c("X.U.FEFF.time"),
    rowSelection=floor(as.numeric(X.U.FEFF.time)) ==
                     floor(as.numeric(WarnungZeit)))

我收到此错误:

ERROR: The sample data set for the analysis has no variables.
Caught exception in file: CxAnalysis.cpp, line: 3756. ThreadID: 4872 Rethrowing.
Caught exception in file: CxAnalysis.cpp, line: 5249. ThreadID: 4872 Rethrowing.
Error in doTryCatch(return(expr), name, parentenv, handler) : 
  ERROR: The sample data set for the analysis has no variables.

你知道我为什么会收到这个错误,我该如何解决?

4

1 回答 1

2

原因是您在全局环境中引用的任何对象rxDataStep都必须显式声明。Microsoft R 函数旨在用于分布式环境,因此您不能假设所有进程都能够访问相同的全局对象。

通过参数声明您的WarnungZeit对象transformObjects,如下所示:

myData <- rxDataStep(inData=SensorData, varsToKeep=c("X.U.FEFF.time"),
    rowSelection=floor(as.numeric(X.U.FEFF.time)) == floor(as.numeric(wz)),
    transformObjects=list(wz=WarnungZeit))
于 2016-12-13T14:43:45.320 回答