Вопрос

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!

Это было полезно?

Решение

Your package probably fails to load because some dependencies are not installed. This problem usually appears if the NAMESPACE file imports dependencies, which are not declared in the DESCRIPTION file. So if your NAMESPACE contains:

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

than your DESCRIPTION needs to contain a line:

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

The R package manager looks at the DESCRIPTION to install dependencies when installing your package.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top