Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cmdcolin/shinytemplate
A basic template for developing a shiny app as an R package, with some proposed "best practices"
https://github.com/cmdcolin/shinytemplate
Last synced: about 1 month ago
JSON representation
A basic template for developing a shiny app as an R package, with some proposed "best practices"
- Host: GitHub
- URL: https://github.com/cmdcolin/shinytemplate
- Owner: cmdcolin
- License: mit
- Created: 2017-03-01T04:03:04.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-09T02:24:27.000Z (almost 8 years ago)
- Last Synced: 2024-08-13T07:15:41.178Z (4 months ago)
- Language: R
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - cmdcolin/shinytemplate - A basic template for developing a shiny app as an R package, with some proposed "best practices" (R)
README
# shinytemplate
[![Build Status](https://travis-ci.org/cmdcolin/shinytemplate.svg?branch=master)](https://travis-ci.org/cmdcolin/shinytemplate)
Shiny template that lets you develop your shiny app as an R package. This app also tries to demonstrates some other good practices such as
## Goals for functionality
- Allow parsing URL params to switch to different tabs or app states
- Allow seeing changes to code simply with page refreshes if running in "dev mode". Normal `shiny` has this but running as a package needed a slightly modified setup
- Ability to list dependencies in DESCRIPTION file to make installation streamlinedFor time being, this is a template for complete Shiny apps, not widgets that can be included in other Shiny apps
## Goals for code style
- Use code modularization via modules
- Allow users to download and run your app with `devtools::install_github` and then run with `shinytemplate()`
- Consistent code style checks with lint## Install
install.packages('devtools')
devtools::install_github('cmdcolin/shinytemplate')## Running app
The library is intended to be installed via a package manager (as above with install_github) and can be run as follows
library(shinytemplate)
shinytemplate()
The function also accepts some arguments, so if your app benefits from the user supplying arguments, they can run `shinytemplate(option1 = "Random data variable used by shiny app", option2 = "More random data, like paths to data files")`## For developers
An important goal for this template was to allow for code changes to get reloaded by just refreshing the browser which speeds up development
devtools::load_all()
shinytemplate(dev = T)The `devtools::load_all` function loads the library in the current directory, and then `shinytemplateDev` uses runApp pointing to the `inst/appdir` directory