This function is to be used inside the server and UI from your app, in order to call the parameters passed to run_app().

get_golem_options(which = NULL)

Arguments

which

NULL (default), or the name of an option

Value

The value of the option.

Examples

if (FALSE) {

# Define and use golem_options

# 1. Pass parameters to `run_app`

# to set default value, edit run_app like this :
run_app <- function(
  title = "this",
  content = "that"
) {
  with_golem_options(
    app = shinyApp(
      ui = app_ui,
      server = app_server
    ),
    golem_opts = list(
      p1 = p1,
      p3 = p3
    )
  )
}

# 2. Get the values from the UI side

h1(get_golem_options("title"))

# 3. Get the value from the server-side

output$param <- renderPrint({
  paste("param p2 = ", get_golem_options("p2"))
})
}