get_golem_options | R Documentation |
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)
which |
NULL (default), or the name of an option |
The value of the option.
# Define and use golem_options if (interactive()) { # 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")) }) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.