rave-context: Set or Get RAVE context

Description Usage Arguments Details Value See Also

Description

Set or Get RAVE context

Usage

1
2
3
4
5
6
7
8
9
rave_context(
  context,
  package = NULL,
  module_id = NULL,
  instance = NULL,
  .force = FALSE
)

from_rave_context(info = c("context", "package", "module_id", "instance"))

Arguments

context

character or missing. If not missing, will set context before returning current context

package

package name, for example, "ravebuiltins", this is required for rave_module_debug and above

module_id, instance

RAVE module ID and instance object, required for context rave_running and rave_running_local.

.force

internally used, do not use

info

which context information to obtain

Details

There are four contexts in RAVE: default, rave_module_debug, rave_running, and rave_running_local. These four contexts are ordered, with default being the lowest and rave_running_local the highest. The order only has internal meaning and users don't have to remember it. However, the four contexts correspond to different scenarios.

When creating a 'S3' generic function (see rave_context_generics), a default function must be provided to handle the default action of the function.

rave_module_debug is for module developers to use as it minimizes many interactive procedures and dynamically load modules to simplify debugging process. Normally this context is only used in development mode.

rave_running means when start-RAVE command is called, and a shiny app launches within the browser. Many functions might change their behaviors here. For example, data loading process might need to show a modal dialogue instead of asking in the console.

rave_running_local means when module is running without shiny. In this case, and shiny interactive contents need to be switched back to console-based. What differs rave_running_local and default is in the prior context, the module has more information about the state and one can always assume the data has been loaded and use them without validating them. Under default context, nothing can be assumed.

Value

rave_context returns a rave-context object, i.e. a list. from_rave_context returns corresponding context information.

See Also

rave_context_generics


dipterix/raveutils documentation built on July 6, 2020, 12:24 a.m.