DW_fetch_state {formods}R Documentation

Fetch Data Wrangling State

Description

Merges default app options with the changes made in the UI

Usage

DW_fetch_state(
  id,
  input,
  session,
  FM_yaml_file,
  MOD_yaml_file,
  id_UD,
  react_state
)

Arguments

id

Shiny module ID

input

Shiny input variable

session

Shiny session variable

FM_yaml_file

App configuration file with FM as main section.

MOD_yaml_file

Module configuration file with MC as main section.

id_UD

ID string for the upload data module used to handle uploads or the name of the list element in react_state where the data set is stored.

react_state

Variable passed to server to allow reaction outside of module (NULL)

Value

List containing the current state of the DM module including default values from the yaml file as well as any changes made by the user. The structure of the list is defined below.

Examples

# Within shiny both session and input variables will exist,
# this creates examples here for testing purposes:
sess_res = DW_test_mksession(session=list())
session = sess_res$session
input   = sess_res$input

# Configuration files
FM_yaml_file  = system.file(package = "formods", "templates", "formods.yaml")
MOD_yaml_file = system.file(package = "formods", "templates", "DW.yaml")

# We need to specify both the DW module id as well as the
# id of the UD module that feeds into it.
id    = "DW"
id_UD = "UD"

# Creating an empty state object
state = DW_fetch_state(id              = id,
                       input           = input,
                       session         = session,
                       FM_yaml_file    = FM_yaml_file,
                       MOD_yaml_file   = MOD_yaml_file,
                       id_UD           = "UD",
                       react_state     = NULL)


[Package formods version 0.1.6 Index]