Skip to contents

Populates session data for testing or to load a specific analysis.

Usage

FM_app_preload(
  session,
  sources = NULL,
  react_state = list(),
  quickload = FALSE
)

Arguments

session

Shiny session variable (in app) or a list (outside of app)

sources

Vector of at corresponds with the ID used to call the modules UI elements

react_state

Reactive shiny object (in app) or a list (outside of app) used to trigger reactions

quickload

Logical TRUE to load reduced analysis FALSE to load the full analysis

Value

list with the following elements

  • isgood: Boolean indicating the exit status of the function.

  • msgs: Messages to be passed back to the user.

  • all_sess_res: List containing the result for each module stored in the list name with the module ID.

  • session: Returning the session variable to be used in scripting (not in app).

Examples

sources=c(system.file(package="formods", "preload", "ASM_preload.yaml"),
          system.file(package="formods", "preload", "UD_preload.yaml"))
res = FM_app_preload(session=list(), sources=sources)
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → ASM:   dest:   file.path("config","report.docx")
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → ASM:   dest:   file.path("config","report.pptx")
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → ASM:   dest:   file.path("config","report.yaml")
#> → ASM: State initialized
#> → ASM: setting word placeholders: 
#> → ASM:   -> setting docx ph: HEADERLEFT = left header
#> → ASM:   -> setting docx ph: HEADERRIGHT = right header
#> → ASM:   -> setting docx ph: FOOTERLEFT = left footer
#> → ASM: module isgood: TRUE
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → UD:   dest:   file.path("config","report.docx")
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → UD:   dest:   file.path("config","report.pptx")
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → UD:   dest:   file.path("config","report.yaml")
#> → UD: State initialized
#> → UD: module checksum updated:897d952fecbc804999396a96f9df4b20
#> → UD: module isgood: TRUE
#> → # preload_complete is good: TRUE ------------------------------------------