Description Usage Details Value Author(s) See Also Examples
View source: R/findPersistentEnv.R
Find the persistent environment inside a basiliskRun
call,
to allow variables to be passed across calls.
1 |
The persistent environment is where variables can be stored across basiliskRun
calls.
When proc
is an environment, it serves as the persistent environment;
otherwise, if proc
is a process, the global environment of the process is the persistent environment.
Developers should avoid naming persistent variables with the .basilisk
prefix.
These are reserved for internal use and may be overwritten by later calls to basiliskRun
.
An environment to which persistent variables can be assigned,
for use in later basiliskRun
calls on the same proc
.
Aaron Lun
basiliskRun
, where this function can be used.
1 2 3 4 5 6 7 8 9 | # Using the base environment for brevity.
cl <- basiliskStart(NULL)
basiliskRun(proc=cl, function() {
assign(x="snake.in.my.shoes", 1, envir=basilisk::findPersistentEnv())
})
basiliskRun(proc=cl, function() {
get("snake.in.my.shoes", envir=basilisk::findPersistentEnv())
})
basiliskStop(cl)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.