RStudio を使用して、ローカルの OpenCPU シングルユーザー サーバーをセットアップしました。また、単純な test.R ファイルのみを含む独自の R パッケージ (パッケージ名: test ) を作成します。ソースコードは
f1 <- function(x, y) {x+y}
library(opencpu)
RStudio のコンソールに入力して、OpenCPU サーバーを起動しました。以下のプリントを頂きました。
Initiating OpenCPU server...
OpenCPU started.
[httpuv] http://localhost:6067/ocpu
OpenCPU single-user server ready.
と入力してスクリプトを実行できましたcurl http://localhost:6067/ocpu/library/test/R/f1 -d "x=33&y=3"
。
しかし、入力してRスクリプト(test.R)を表示しようとするとcurl http://localhost:6067/ocpu/library/test/R/test.R
、印刷されました
object 'test.R' not found
In call:
get(reqobject, paste("package", reqpackage, sep = ":"), inherits = FALSE)
また、 test.R スクリプトを入力して実行すると失敗しましたcurl http://localhost:6067/ocpu/library/test/R/test.R -X POST -d "x=3&y=4"
。そのようなスクリプトを実行できますか?
誰でもこれを手伝ってもらえますか?ありがとう。