snapapps package contains a collection of open source Shiny apps by Matthew Leonawicz at the Scenarios Network for Alaska and Arctic Planning, University of Alaska Fairbanks. It is a member package in the apps and docs sector of the SNAPverse collection of R packages. Many of the apps in this package originate from the SNAP open source Shiny apps GitHub repository. Additional apps can be found in other related packages including
I am slowly adding more apps to this package. Like much of the SNAPverse,
snapapps is currently an early work in progress.
You can install snapapps from github with:
# install.packages('devtools') devtools::install_github("leonawicz/snapapps")
The purpose of
snapapps is to give you easy access to local instances of SNAP Shiny apps that you can run in your browser. By installing
snapapps you have local access to a number of Shiny apps. You can launch apps by passing their respective IDs to
snapp. For example, version four of the Distributions of Random Variables app:
The package also gives you access to app source code if you are an R user who learns by digging and is comfortable going through package source files. An easy way to view the source code is side by side or directly below the app content in your browser by running the app in showcase mode. Showcase mode will also present additional, concise app metadata and description.
snapp("rv4", local_mode = "showcase")
However, you may still find it much more convenient in this regard to simply fork the GitHub repository where most of the apps in
snapapps originate. Showcase mode will also not display equally well for all apps, depending on how they are organized and presented in the browser.
The list of app IDs can be obtained with
snapps, which provides information about all of the apps in the collection. This function returns a data frame with columns that include app ID and short descriptions as well as a number of other pieces of relevant metadata. See the
snapps help documentation or the package vignette for details.
snapps() #> # A tibble: 9 x 10 #> id name descript~ publi~ revi~ rati~ stat~ aws url redirect #> <chr> <chr> <chr> <dbl> <dbl> <fct> <chr> <lgl> <chr> <chr> #> 1 rv RV dis~ Distribu~ 2017 2017 Begi~ comp~ F https:/~ http://~ #> 2 twe Temper~ Coastal ~ 2013 2017 Inte~ comp~ T https:/~ http://~ #> 3 sic Sea ic~ Alaska s~ 2013 2017 Inte~ comp~ T https:/~ http://~ #> 4 siw Sea ic~ Coastal ~ 2013 2017 Inte~ comp~ T https:/~ http://~ #> 5 rv1 RV dis~ Distribu~ 2013 2017 Begi~ comp~ F https:/~ http://~ #> 6 rv2 RV dis~ Distribu~ 2013 2017 Begi~ comp~ F https:/~ http://~ #> 7 rv3 RV dis~ Distribu~ 2013 2017 Begi~ comp~ F https:/~ http://~ #> 8 rv4 RV dis~ Distribu~ 2013 2017 Begi~ comp~ F https:/~ http://~ #> 9 tring Tree r~ Climate ~ 2013 2017 Begi~ comp~ F https:/~ http://~
One piece of information that is particularly useful is the canonical live link for an app. Currently, most SNAP Shiny apps are hosted on RStudio's
shinyapps.io platform. While these URLs appear in the metadata table, they can also be launched directly by passing
source = "remote" to
snapp("rv4", source = "remote")
This will again launch the app in your browser, but this time via the canonical URL. Apps hosted remotely on
shinyapps.io generally take notably longer to load than local apps. This is another convenience of
One drawback is that some apps are too large to include in official form in
snapapps as a consequence of the amount of data they use, or more likely, the amount of data they require access to. For example, an app may access data from a large data repository on Amazon Web Services using private keys that are not included in this package. For such an app to run locally, it must have a copy of the data stored with it. In order to include these apps in the package, the data is cut drastically down to almost nothing. The app will be the same, but the data it offers is a shell in comparison to the canonical version hosted online.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.