Accessing objects in opencpu sessions

2019-06-03 01:00发布

How do I access a specific object in an opencpu "session" in a subsequent function call?

Given a request, say to

/ocpu/library/base/R/eval

with parameter

 expr = "x <- 10; y <- 20"

Which gives

/ocpu/tmp/x08dfddafe3/R/.val
/ocpu/tmp/x08dfddafe3/R/x
/ocpu/tmp/x08dfddafe3/R/y
/ocpu/tmp/x08dfddafe3/stdout 
/ocpu/tmp/x08dfddafe3/source
/ocpu/tmp/x08dfddafe3/console
/ocpu/tmp/x08dfddafe3/info

Now .val has the value 20.

Suppose I wanted to pass x to

ocpu/library/stats/R/rnorm

Is there a quick way to that, something like

n = x08dfddafe3/R/x

in "pseudo"...

标签: r opencpu
1条回答
狗以群分
2楼-- · 2019-06-03 01:37

Great question. Starting version 1.4.4 there are two ways of doing this:

查看更多
登录 后发表回答