1

I've written a OpenCPU app package and have successfully tested it in single server mode. The server is setup and it can find the app no problem.

But it's erroring out on some of the ocpu calls with the following (from Chrome JS console):

POST http://mydomain/ocpu/library/userengagementdashboard/R/metricsList 400 (Bad       Request) jquery-1.10.2.min.js:6
OpenCPU error HTTP 400
package or namespace load failed for 'userengagementdashboard'

In call:
NULL

Didn't get these errors in the single user server mode.

If I check on http://mydomain/ocpu/library/userengagementdashboard/NAMESPACE I get:

export(aggregatePlot)
export(clusterFun)
export(facetPlot)
export(facetsList)
export(getDataAll)
export(getDataFacet)
export(getDataTime)
export(getDataTimeFacet)
export(mergeClusters)
export(metricsList)
export(timeFacetPlot)
export(timePlot)
import(RDruid)
import(ggplot2)
import(lubridate)
import(parallel)
import(plyr)
import(reshape)

Is there a problem with my imports maybe?

UPDATE:

Solved this thanks to Jeroen's suggestion that I perhaps didn't have all the dependencies.

First I looked at the dependencies under http://mydomain/ocpu/library/ and installed any missing packages to the correct library location.

Then some of the imports and dependencies of these dependent packages had not been installed so I installed their dependencies as well. Problem solved!

4

1 回答 1

0

您的包可能无法加载,因为未安装某些依赖项。如果NAMESPACE文件导入未在文件中声明的依赖项,通常会出现此问题DESCRIPTION。因此,如果您NAMESPACE包含:

import(RDruid)
import(ggplot2)
import(lubridate)
import(parallel)
import(plyr)
import(reshape)

比您DESCRIPTION需要包含一行:

Imports: Druid, ggplot2, lubridate, parallel, plyr, reshape

R 包管理器会在DESCRIPTION安装包时查看要安装的依赖项。

于 2014-02-20T19:28:18.517 回答