https://github.com/jbryer/ShinyDemo
Package for running Shiny apps like R package demos
https://github.com/jbryer/ShinyDemo
Last synced: 2 months ago
JSON representation
Package for running Shiny apps like R package demos
- Host: GitHub
- URL: https://github.com/jbryer/ShinyDemo
- Owner: jbryer
- Created: 2014-08-25T18:10:14.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2025-06-13T16:04:00.000Z (4 months ago)
- Last Synced: 2025-06-13T16:31:58.698Z (4 months ago)
- Language: R
- Size: 1.53 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - jbryer/ShinyDemo - Package for running Shiny apps like R package demos (R)
README
##
ShinyDemo - Package for Running Shiny Apps Like Package Demos
[](https://cran.r-project.org/package=ShinyDemo)
[](https://github.com/jbryer/ShinyDemo)
[](https://github.com/jbryer/ShinyDemo/actions)#### Author: Jason Bryer ()
#### Website:
This package is designed to run Shiny apps included in packages in the
inst/shiny/ directory. In addition to providing a standardized way of
running apps within packages, it extends the typical process of running
Shiny apps by allowing function parameters to be passed to the
application. Utility functions for the developer are provided to safely
check for parameter values and to retrieve defaults if the application
is run outside of the package.#### Installation
The latest version of the `ShinyDemo` package can be installed using the
\`remotes\`\` package.``` r
remotes::install_github('jbryer/ShinyDemo')
```For package developers, simply include your Shiny apps in the `inst/`
directory within your R package. The `ShinyDemo::shiny_demo()` function
will automatically find those apps.``` r
library('ShinyDemo')
ShinyDemo::shiny_demo()
```## package app
## 1 ShinyDemo df_viewer
## 2 ShinyDemo environment
## 3 ShinyDemo gambler
## app_dir
## 1 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/ShinyDemo/df_viewer
## 2 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/ShinyDemo/environment
## 3 /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/ShinyDemo/gamblerYou can also pass arbitrary parameters to Shiny applications. The
following examples passes a list of data frames to a simple [data frame
viewer
application](https://github.com/jbryer/ShinyDemo/blob/master/R/df_viewer.R).``` r
library('ShinyDemo')
data("mtcars"); data("faithful")
runAppWithParams(ui = ShinyDemo::df_viewer_ui,
server = ShinyDemo::df_viewer_server,
data_frames = list(mtcars = mtcars, faithful = faithful),
port = 2112)
```#### Development
This package uses the `devtools` package for development.
``` r
# Generate the package documentation
usethis::use_tidy_description()
devtools::document()
# Install the package
devtools::install()
# Run CRAN check
devtools::check(cran = TRUE)
```