add_options: Pass objects and customization options to a shiny app

Description Usage Arguments Details Value See Also

View source: R/add_options.R

Description

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

Usage

1
2
3
4
5
6
7
8
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

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.

Value

A list of shiny options set with shinyOptions

See Also

add_css

add_logo


teachingApps documentation built on July 1, 2020, 5:58 p.m.