knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The aim of the package demoShiny is to mimic the demo functionality for Shiny apps for a package.
With demoShiny you can get an overview about all apps from the loaded packages:
library("demoShiny") demoShiny()
The output is a data frame with package::topic and the file or directory which would be called by demoShiny.
You can question for specific apps:
demoShiny('demoShiny')
It will deliver all demo apps of the package demoShiny AND all apps named demoShiny!
In case that for your topic is just one app available then no list will be returned but the Shiny demo app will be started:
# full topic demoShiny('demoShiny::hist') # if only one app is available then it will be run demoShiny('hist') # abbreviation for topics or packages can used demoShiny('d::hist')
inst/shinyIf you develop a package then create under inst a directory shiny.
Each subdirectory of shiny can contain one app. The name of the subdirectory is the topic name.
list.files(system.file('shiny', package="demoShiny"), include.dirs=TRUE)
As you can see the shiny subdirectory of demoShiny contains several directories, e.g. app1, silhouette, and also a file app1.R.
If you put an R file with the same name as a directory then the R file is sourced instead of calling the app in the directory. The aim is to allow for a specific calls to the app, e.g. by setting URL parameters:
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.