Learn R Programming

teachingApps (version 1.0.8)

add_options: Pass objects and customization options to a shiny app

Description

Provides a general method for passing arguments to shiny apps allowing for dynamic customization.

Usage

add_options(
  opts,
  dir,
  theme = "flatly",
  icon = NULL,
  img = NULL,
  git_user = NULL
)

Arguments

opts

A list of additional options or objects to pass to a shiny app

dir

A character string indicating the path to the directory containing ui.R and server.R

theme

A character string naming a Bootswatch color theme (used by shinythemes::shinytheme)

icon

A character string naming a fontAwesome icon to be placed in the footer of a navbarPage app

img

A character string for the path/url of an image to be placed in the footer of a navbarPage app

git_user

A character string for github username used in the branding link

Value

A list of shiny options set with shinyOptions

Details

Shiny apps are not functions. Thus, customization options cannot be passed to a shiny app as simply as arguments are passed between functions. Further, the manner in which objects are loaded prior to deploying an app differ if the app will be published as a stand-alone or embedded within an rmarkdown docmuent. Assigning objects as shiny::shinyOptions ensures that these values are passed to a shiny app and can be deployed.

See Also

add_css

add_logo