load_reactive_objects {shinyobjects} | R Documentation |
Load inputs and convert reactive functions from an R/Rmd script to your environment
Description
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.
Usage
load_reactive_objects(
file,
restart = FALSE,
envir = NULL,
clear_environment = FALSE,
keep = NULL
)
Arguments
file |
Rmd to be evaluated and loaded into your environment |
restart |
When |
envir |
the environment shinyobjects should the load the objects into. |
clear_environment |
When |
keep |
a regular expression of objects to keep when |
Warning
This function has the ability to overwrite your objects in your environment. Make sure you understand how this function works before moving forward.
Examples
if (interactive()) {
system.file(package = "shinyobjects", "Rmd/test_dashboard.Rmd") %>%
load_reactive_objects()
system.file(package = "shinyobjects", "Rmd/test_dashboard_no_inputs.Rmd") %>%
load_reactive_objects()
system.file(package = "shinyobjects", "Rmd/test_dashboard_missing_inputs.Rmd") %>%
load_reactive_objects()
}