This function will run all assignments of your R or Rmd. file In the process, this function will encourage the creation of a dummy input list that will mimic user input and allow your code to run. Lastly, reactive objects are converted to functions so they can still be called as df() etc.

load_reactive_objects(file, clear_environment = FALSE, restart = FALSE,
  keep = NULL)

Arguments

file

Rmd to be evaluated and loaded into global environment

clear_environment

When TRUE, will remove objects not named in ...

restart

When TRUE, will restart the current R session. If you have R default to restore RData by default, you will need to use the clear_environment argument as well

keep

a regular expression of objects to keep when clear_environment = TRUE

Warning

This function has the ability to overwrite your objects in your global environment. Make sure you understand how this function works before moving forward.

Examples

# NOT RUN {
system.file(package = "shinysim", "Rmd/test_dashboard.Rmd") %>%
 load_reactive_objects()

system.file(package = "shinysim", "Rmd/test_dashboard_no_inputs.Rmd") %>%
 load_reactive_objects()

system.file(package = "shinysim", "Rmd/test_dashboard_missing_inputs.Rmd") %>%
 load_reactive_objects()
# }