Skip to contents

Defines 'RAVE' Module Initialization Defines the global variables for the module. Called along with define_input to define UI initialization actions once a subject is loaded.

Usage

define_initialization(expr)

# S3 method for default
define_initialization(expr)

# S3 method for rave_module_debug
define_initialization(expr)

# S3 method for rave_running
define_initialization(expr)

# S3 method for rave_running_local
define_initialization(expr)

Arguments

expr

R expression to run after subject is loaded

Value

None

Examples


if (FALSE) {
# Requires to install R package beauchamplab/ravebuiltins

# Enable debug mode
ravebuiltins::dev_ravebuiltins(reload = FALSE)
# Check data
define_initialization({
  rave_checks('power')
  power <- module_tools$get_power(referenced = TRUE)
})


# Initialize global variables for modules
ravebuiltins::dev_ravebuiltins(reload = FALSE)
define_initialization({
  print(subject$info())
  time_points = preload_info$time_points
})
define_input(
  shiny::sliderInput('time_range', 'Time-Range', min=0, 
                     max=1, value = c(0,1)),
  init_args = c('min', 'max', 'value'),
  init_expr = {
    min = min(time_points)
    max = max(time_points)
    value = c(0, max)
  }
)
}