| ExecEnvir | R Documentation |
where all the module functions are executed. It's rarely created
manually, use get_module to create module, run with
start_app(m, test.mode=TRUE), and then inspect modules.
.__rave_context__.context string for current instance, indicating whether the module is running locally (public, but internally used)
.__rave_package__.current package name to run (public, but internally used)
.__rave_module__.module ID (public, but internally used)
.__rave_module_instance__.self instance (public, but internally used)
module_envModuleEnvir instance
cache_envcache environment to store key-value pairs locally
parent_envthe parent/top environment of the module, usually global environment or some name-space if the module is implemented as an R package
wrapper_envstores all the utility functions. Some functions are
overridden there such as observe,
rave_checks, or eval_when_ready. These functions behave
differently inside or outside of shiny context, and with or without data
loaded. The environment will be locked once the module is initialized.
The parent environment is parent_env
static_envstores module static functions. These functions are
evaluated under parse_env and then moved here. The environment
is locked after initialization. Its parent environment is
wrapper_env
param_envstores parameters and most of the user inputs. It can
also serve as a repository for global variables. Unlike the previous
environments, param_env is unlocked, but module creators do not
have access to this environment directly. The parent environment is
static_env
runtime_envwhere the main part of module is running. All shiny
observe and observeEvent are
redirected to this environment by default (unless using
shiny::observe). All functions in static_env have access
to this environment. The parent environment is param_env
async_envwhere asynchronous codes run
parse_envenvironment where modules are parsed. The parent
environment is runtime_env. Once all functions are evaluated,
this environment is not used. However, module creators don't directly
access this environment once the module is initialized.
nsshiny name-space functions, is equivalent to
shiny::NS(module_id). The goal is to add prefixes to module inputs
so that two modules with the same input ID are named differently
auto_execute(Deprecated) whether to auto-calculate results
manual_inputIdscharacter vector; name list of manually input IDs. Used when the algorithm takes long to run
rendering_inputIdscharacter vector; name list of input IDs that
when one of the corresponding inputs is changed, then rave_execute
will not get evaluated. Only the outputs are changed.
input_updateexpressions to update inputs
register_output_eventsexpressions to register outputs
register_input_eventsexpressions to register inputs
executemodule main function. The function is dynamically generated. Don't call directly.
async_module(experimental) whether the module contains any asynchronous part
global_reactivesshiny global reactives, internal use only
local_reactivesshiny local reactives, internal use only
internal_reactivesinternal reactive values to control some elements, internal use only
ready_functionsfunctions to run when the module is ready. The
functions are called at the last step of shinirize.
Usually it's used along with eval_when_ready, to make sure
global_reactives and local_reactives getting registered
before functions calls
input_idsvector of input IDs (read-only)
input_labelsvector of input labels (read-only)
output_labelsvector of output labels (read-only)
output_idsvector of output IDs (read-only)
reload()(experimental) signal the modules to reload
ExecEnvir$reload()
none
finalize()garbage collection
ExecEnvir$finalize()
none
info()print variables in different layers (environment)
ExecEnvir$info()
none
print()print the memory address
ExecEnvir$print(...)
...ignored
memory address
clean()clean the environments to release the resource
ExecEnvir$clean()
none
new()constructor
ExecEnvir$new(session = getDefaultReactiveDomain(), parent_env = NULL)
sessionshiny session instance
parent_envparent environment of this instance: package name space or global environment
reset()reset the runtime environment, rarely used
ExecEnvir$reset(inputs)
inputsreactive value list
none
copy()(deprecated) copy the instance locally
ExecEnvir$copy( session_id = "__fake_runtime_env__", data_env = getDefaultDataRepository() )
session_idcharacter
data_envwhere the data is stored, default is the environment
returned by getDefaultDataRepository
a copied instance
execute_with()(deprecated) execute module with given parameter
ExecEnvir$execute_with(param, async = FALSE, plan = NULL)
paramnamed list
asyncwhether to run the whole module
planfuture plan
runtime environment
names()returns names of a list, if names are null, returns blank characters
ExecEnvir$names(x)
xa list
the names of the list
register_module()register ModuleEnvir instance
ExecEnvir$register_module(module_env)
module_envModuleEnvir instance. The modules
are shared across different sessions, but to run the module, we need
to create runtime environment, which is ExecEnvir
none
register_context()Register 'RAVE' context for current environment (internally used)
ExecEnvir$register_context(context = c("rave_running", "rave_running_local"))contextcontext string to indicate whether the module is running locally
None
rave_inputs()parse input components
ExecEnvir$rave_inputs( ..., .input_panels = list(), .tabsets = list(), .env = NULL, .manual_inputs = NULL, .render_inputs = NULL )
...shiny input calls, such as textInput('id', 'Name', ...)
.input_panels, .tabsetstogether define the input layouts
.envignored, debug only
.manual_inputsinput IDs that won't cause module re-calculate when inputs are updated
.render_inputsinput IDs that only trigger render functions when updated
none
rave_outputs()parse output components
ExecEnvir$rave_outputs( ..., .output_tabsets = list(), .tabsets = list(), .env = NULL )
...shiny output calls, such as plotOutput('id', 'Title')
.output_tabsets, .tabsetstogether define the output layouts
.envdebug use
none
rave_updates()input initialization when iEEG/ECoG data are imported
ExecEnvir$rave_updates(..., .env = NULL)
...R expressions
.envfor debug use
rave_execute()parse, and compile to main function
ExecEnvir$rave_execute(..., auto = TRUE, .env = NULL, async_vars = NULL)
...R expressions
autowhether the module should run automatically
.envdebug use
async_varsvariables further passed to async module
none, but ExecEnvir$execute will be generated.
set_browser()(experimental) cache R expression in browser
localStorage
ExecEnvir$set_browser(expr, session = getDefaultReactiveDomain())
exprR expression
sessionshiny session instance
generate_input_ui()generate input panels according to parsed rave_inputs
ExecEnvir$generate_input_ui(sidebar_width = 3L)
sidebar_widthinteger from 1 to 11, the width of the input panels
HTML tags
generate_output_ui()generate outputs labels according to parsed
rave_outputs
ExecEnvir$generate_output_ui(sidebar_width = 3L)
sidebar_widthinteger from 1 to 11, the width of the input panels,
the output panel width is calculated as 12-sidebar_width
HTML tags
is_global()(deprecated) check if variable is shared across modules.
Please use cache_input instead to get variable values.
ExecEnvir$is_global(inputId)
inputIdinput ID
clone()The objects of this class are cloneable with this method.
ExecEnvir$clone(deep = FALSE)
deepWhether to make a deep clone.
Zhengjia Wang
## Not run:
# Load module
module <- get_module('ravebuiltins', 'power_explorer')
# Create execute environmen
execenv <- module$get_or_new_exec_env()
execenv$info()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.