How to use rxExec to run standard R remote?

怎甘沉沦 提交于 2019-12-02 11:17:43

问题


I'm trying to call the Standard R code via the function "rxExec" to execute the code remote.

My compute context is RxInSqlServer() and the connection to the server is fine.

Is this call possible in general? Or is there a better way to perform Standard R remote via SQL R Server Services?

function1 <- function(varIn,varOut) {
  df<- rxImport(varIn)
  df<- ... [STANDARD R CODE]
  rxDataStep(inData = df,
             outFile = varOut
             numRows=1000)
}

rxSetComputeContext(cc)

sql <- "SELECT * FROM ..."
dbIn <- RxSqlServerData(sqlQuery = sql,
                                connectionString = conn)
dbOut <- RxSqlServerData(table = "nameTable",
                           connectionString = conn)

rxExec(function1, varIn = dbIn, varOut = dbOut) 

With a similar example, but without writting the Data-Output i a table only with a return value I get the same error

function1 <- function(varIn) {
  df<- rxImport(varIn)
  df<- ... [STANDARD R CODE]
  return(data)
}

rxSetComputeContext(cc)

sql <- "SELECT * FROM ..."
dbIn <- RxSqlServerData(sqlQuery = sql,
                                connectionString = conn)

x<- rxExec(function1, varIn = dbIn) 

Error message: Warning: namespace 'CompatibilityAPI' is not available and has been replaced by .GlobalEnv when processing object 'inputObject'

Error in slot(from, what) : no slot of name "maxColWidth" for this object of class "RxSqlServerData" Calls: source ... anyStrings -> validityMethod -> as -> asMethod -> slot Execution halted

Error in rxCompleteClusterJob(hpcServerJob, consoleOutput, autoCleanup) : No results available - final job state: failed

Thanks!

来源:https://stackoverflow.com/questions/43775573/how-to-use-rxexec-to-run-standard-r-remote

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!