├── .Rbuildignore ├── .gitignore ├── shiny-examples-master ├── docker-rsc-deployer │ ├── .gitignore │ └── deployApp.R ├── 051-movie-explorer │ ├── .Renviron │ ├── movies.db │ ├── DESCRIPTION │ ├── global.R │ └── README.md ├── 054-nvd3-line-chart-output │ ├── www │ │ └── nvd3 │ │ │ ├── src │ │ │ ├── outro.js │ │ │ └── intro.js │ │ │ ├── .jshintrc │ │ │ ├── examples │ │ │ └── images │ │ │ │ ├── grey-plus.png │ │ │ │ ├── grey-minus.png │ │ │ │ └── nvd3_sampleLineChart1.png │ │ │ ├── build.bat │ │ │ ├── package.json │ │ │ ├── .gitignore │ │ │ ├── test │ │ │ ├── teststyle.css │ │ │ └── testScript.js │ │ │ └── bower.json │ ├── global.R │ ├── DESCRIPTION │ ├── output.Rproj │ └── server.R ├── 096-plot-interaction-article-1 │ ├── deps.R │ └── app.R ├── 097-plot-interaction-article-2 │ └── deps.R ├── 098-plot-interaction-article-3 │ ├── deps.R │ └── app.R ├── 099-plot-interaction-article-4 │ ├── deps.R │ └── app.R ├── 100-plot-interaction-article-5 │ ├── deps.R │ └── app.R ├── 101-plot-interaction-article-6 │ ├── deps.R │ └── app.R ├── 102-plot-interaction-article-7 │ ├── deps.R │ └── app.R ├── 103-plot-interaction-article-8 │ ├── deps.R │ └── app.R ├── 169-prerender-a │ ├── js │ │ └── log-rmd.js │ └── index.Rmd ├── 114-modal-dialog │ ├── README.md │ ├── DESCRIPTION │ └── app.R ├── 015-layout-navbar │ ├── server.R │ ├── ui.R │ └── DESCRIPTION ├── 136-plot-cache │ ├── README.md │ ├── DESCRIPTION │ └── app.R ├── 156-subapps │ ├── app3 │ │ ├── server.R │ │ └── ui.R │ ├── app2 │ │ ├── www │ │ │ ├── app2_styles.css │ │ │ └── index.html │ │ └── app.R │ └── README.md ├── 053-navlistpanel-example │ ├── server.r │ ├── README.md │ ├── DESCRIPTION │ └── ui.r ├── 107-events │ ├── Readme.md │ └── DESCRIPTION ├── 116-notifications │ ├── README.md │ └── DESCRIPTION ├── 086-bus-dashboard │ ├── metrotransit-data │ │ ├── .gitignore │ │ ├── rds │ │ │ ├── shapes.rds │ │ │ └── trips.rds │ │ └── metrotransit-data.Rproj │ ├── dependencies.R │ ├── DESCRIPTION │ └── README.md ├── 111-insert-ui │ ├── README.md │ ├── DESCRIPTION │ ├── ui.R │ └── server.R ├── 048-including-html-text-and-markdown-files │ ├── server.r │ ├── DESCRIPTION │ ├── include.html │ ├── include.txt │ ├── README.md │ ├── ui.r │ └── include.md ├── 168-supporting-r-dir │ ├── ui.R │ ├── server.R │ ├── DESCRIPTION │ ├── R │ │ └── counter.R │ └── Readme.md ├── 137-plot-cache-key │ ├── README.md │ └── DESCRIPTION ├── 113-bookmarking-url │ ├── README.md │ ├── DESCRIPTION │ └── app.R ├── 169-prerender-b │ ├── www │ │ └── js │ │ │ └── run-test.js │ └── app.R ├── 138-icon-fontawesome │ ├── README.md │ └── DESCRIPTION ├── 144-colors │ ├── countries.rds │ └── countries.R ├── 082-word-cloud │ ├── romeo.txt.gz │ ├── summer.txt.gz │ ├── merchant.txt.gz │ ├── screenshot.png │ ├── README.md │ ├── DESCRIPTION │ └── ui.R ├── 047-image-output │ ├── images │ │ ├── face.png │ │ └── chainring.jpg │ ├── DESCRIPTION │ ├── ui.R │ └── README.md ├── 084-single-file │ ├── README.md │ ├── DESCRIPTION │ └── app.R ├── 063-superzip-example │ ├── data │ │ ├── superzip.rds │ │ ├── -revisedmurrayfile_111952895138.xls │ │ └── deps.sh │ ├── DESCRIPTION │ ├── gomap.js │ ├── README.md │ └── global.R ├── 081-widgets-gallery │ ├── www │ │ └── texturebg.png │ ├── DESCRIPTION │ ├── widgets.Rproj │ └── server.R ├── 067-vertical-layout │ ├── server.R │ ├── DESCRIPTION │ ├── README.md │ └── ui.R ├── 036-custom-input-control │ ├── server.R │ ├── DESCRIPTION │ └── ui.R ├── 154-index-html-server-r │ ├── server.R │ └── www │ │ └── index.html ├── 167-resource-warnings │ ├── www │ │ └── images │ │ │ └── rstudio.png │ └── app.R ├── 020-knit-html │ ├── DESCRIPTION │ ├── ui.R │ ├── Readme.md │ └── report.Rmd ├── 039-download-file │ ├── README.md │ ├── DESCRIPTION │ └── ui.R ├── 165-trailing-comma │ ├── Readme.md │ ├── DESCRIPTION │ └── app.R ├── 010-download │ ├── Readme.md │ └── DESCRIPTION ├── 083-front-page │ ├── README.md │ ├── DESCRIPTION │ ├── front-page.Rproj │ ├── server.R │ └── ui.R ├── 164-no-whitespace │ ├── DESCRIPTION │ └── Readme.md ├── 019-mathjax │ ├── DESCRIPTION │ ├── Readme.md │ └── ui.R ├── 026-shiny-inline │ └── DESCRIPTION ├── 080-widget-text │ ├── DESCRIPTION │ ├── server.R │ ├── ui.R │ └── README.md ├── 011-timer │ ├── DESCRIPTION │ ├── Readme.md │ └── app.R ├── 017-select-vs-selectize │ ├── Readme.md │ ├── DESCRIPTION │ └── server.R ├── 022-unicode-chinese │ ├── DESCRIPTION │ ├── Readme.md │ └── ui.R ├── 070-widget-checkbox │ ├── DESCRIPTION │ ├── server.R │ ├── ui.R │ └── README.md ├── 071-widget-date │ ├── DESCRIPTION │ ├── server.R │ └── ui.R ├── 074-widget-numeric │ ├── server.R │ ├── DESCRIPTION │ ├── ui.R │ └── README.md ├── 075-widget-radio │ ├── DESCRIPTION │ ├── server.R │ ├── ui.R │ └── README.md ├── 076-widget-select │ ├── DESCRIPTION │ ├── server.R │ └── ui.R ├── 079-widget-submit │ ├── DESCRIPTION │ ├── server.R │ ├── ui.R │ └── README.md ├── 109-render-table │ └── DESCRIPTION ├── 120-goog-index │ ├── README.md │ ├── DESCRIPTION │ └── data │ │ └── trend_description.csv ├── 005-sliders │ ├── DESCRIPTION │ └── Readme.md ├── 006-tabsets │ ├── DESCRIPTION │ └── Readme.md ├── 007-widgets │ ├── DESCRIPTION │ └── Readme.md ├── 008-html │ ├── DESCRIPTION │ └── Readme.md ├── 009-upload │ ├── DESCRIPTION │ └── Readme.md ├── 014-onflushed │ ├── DESCRIPTION │ ├── ui.R │ └── server.R ├── 025-loop-ui │ ├── DESCRIPTION │ ├── Readme.md │ ├── ui.R │ └── server.R ├── 066-upload-file │ ├── DESCRIPTION │ ├── README.md │ ├── www │ │ └── pressure.tsv │ └── server.R ├── 073-widget-file │ ├── DESCRIPTION │ ├── server.R │ └── ui.R ├── 004-mpg │ ├── DESCRIPTION │ └── Readme.md ├── 012-datatables │ ├── DESCRIPTION │ └── Readme.md ├── 013-selectize │ ├── DESCRIPTION │ ├── Readme.md │ └── server.R ├── 068-widget-action-button │ ├── DESCRIPTION │ ├── server.R │ ├── ui.R │ ├── action-button.Rproj │ └── README.md ├── 069-widget-check-group │ ├── DESCRIPTION │ ├── server.R │ ├── ui.R │ └── README.md ├── 072-widget-date-range │ ├── DESCRIPTION │ ├── server.R │ └── ui.R ├── 108-module-output │ ├── DESCRIPTION │ ├── Readme.md │ └── app.R ├── 110-error-sanitization │ ├── DESCRIPTION │ └── README.md ├── 117-shinythemes │ ├── DESCRIPTION │ └── README.md ├── 155-index-html-app-r │ ├── app.R │ └── www │ │ └── index.html ├── 015-layout-sidebar │ ├── DESCRIPTION │ ├── ui.R │ └── server.R ├── 052-navbar-example │ ├── DESCRIPTION │ ├── about.md │ └── server.R ├── 077-widget-slider │ ├── DESCRIPTION │ ├── server.R │ └── ui.R ├── 112-generate-report │ ├── DESCRIPTION │ ├── README.md │ └── report.Rmd ├── 115-bookmarking-updatequerystring │ ├── README.md │ ├── DESCRIPTION │ └── app.R ├── 018-datatable-options │ ├── DESCRIPTION │ └── ui.R ├── 078-widget-slider-range │ ├── DESCRIPTION │ ├── server.R │ └── ui.R ├── 085-progress │ ├── DESCRIPTION │ ├── ui.R │ └── README.md ├── 021-selectize-plot │ ├── DESCRIPTION │ └── ui.R ├── 023-optgroup-server │ ├── DESCRIPTION │ ├── Readme.md │ └── server.R ├── 024-optgroup-selectize │ ├── DESCRIPTION │ ├── server.R │ └── Readme.md ├── 033-conditionalpanel-demo │ ├── server.R │ ├── DESCRIPTION │ └── ui.R ├── 034-current-time │ ├── DESCRIPTION │ ├── server.R │ └── ui.R ├── 049-isolate-demo │ ├── DESCRIPTION │ ├── README.md │ └── ui.R ├── 088-action-pattern1 │ ├── DESCRIPTION │ ├── 088-action-pattern1.Rproj │ ├── www │ │ └── message-handler.js │ └── app.R ├── 089-action-pattern2 │ ├── DESCRIPTION │ ├── 089-action-pattern2.Rproj │ └── app.R ├── 090-action-pattern3 │ ├── DESCRIPTION │ ├── 090-action-pattern3.Rproj │ └── app.R ├── 091-action-pattern4 │ ├── DESCRIPTION │ ├── 091-action-pattern4.Rproj │ └── app.R ├── 092-action-pattern5 │ ├── DESCRIPTION │ └── 092-action-pattern5.Rproj ├── 016-knitr-pdf │ ├── DESCRIPTION │ ├── Readme.md │ ├── report.Rmd │ └── ui.R ├── 055-observer-demo │ ├── DESCRIPTION │ ├── README.md │ ├── server.R │ └── ui.R ├── 087-crandash │ ├── DESCRIPTION │ └── README.md ├── 093-plot-interaction-basic │ ├── README.md │ └── DESCRIPTION ├── 028-actionbutton-demo │ ├── README.md │ ├── DESCRIPTION │ ├── server.r │ └── ui.r ├── 105-plot-interaction-zoom │ ├── DESCRIPTION │ └── README.md ├── 062-submitbutton-demo │ ├── DESCRIPTION │ ├── server.r │ ├── ui.r │ └── README.md ├── 065-update-input-demo │ ├── DESCRIPTION │ └── README.md ├── 094-image-interaction-basic │ ├── DESCRIPTION │ └── README.md ├── 095-plot-interaction-advanced │ └── DESCRIPTION ├── 030-basic-datatable │ ├── DESCRIPTION │ └── server.R ├── 037-date-and-date-range │ ├── DESCRIPTION │ └── server.R ├── 041-dynamic-ui │ ├── DESCRIPTION │ ├── README.md │ └── ui.R ├── 104-plot-interaction-select │ ├── DESCRIPTION │ └── README.md ├── 106-plot-interaction-exclude │ ├── DESCRIPTION │ └── README.md ├── 118-highcharter-births │ └── DESCRIPTION ├── docker │ └── shiny-server.sh ├── 035-custom-input-bindings │ ├── DESCRIPTION │ ├── ui.R │ ├── server.R │ └── README.md ├── 040-dynamic-clustering │ ├── DESCRIPTION │ └── ui.R ├── 057-plot-plus-three-columns │ ├── DESCRIPTION │ └── server.R ├── 064-telephones-by-region │ ├── DESCRIPTION │ ├── server.R │ └── ui.R ├── 027-absolutely-positioned-panels │ ├── DESCRIPTION │ └── server.R ├── 061-server-to-client-custom-messages │ ├── www │ │ └── message-handler.js │ ├── DESCRIPTION │ ├── server.R │ ├── ui.R │ └── README.md ├── 119-namespaced-conditionalpanel-demo │ └── DESCRIPTION ├── 032-client-data-and-query-string │ ├── DESCRIPTION │ ├── ui.r │ └── README.md ├── 050-kmeans-example │ ├── DESCRIPTION │ ├── ui.R │ └── server.R ├── 059-reactive-poll-and-file-reader │ ├── DESCRIPTION │ ├── README.md │ └── ui.R ├── 060-retirement-simulation │ └── DESCRIPTION ├── shiny-examples.Rproj ├── 151-reactr-input │ └── js │ │ └── input.js ├── 141-radiant │ ├── app.R │ └── README.md ├── .gitignore ├── 130-output-null │ └── app.R ├── 176-jquery-3 │ └── app.R ├── 148-addresourcepath-deleted │ └── app.R ├── 170-date-range-max │ └── app.R ├── 146-ames-explorer │ ├── helpers │ │ └── data_functions.R │ └── README.md ├── 128-plot-dim-error │ └── app.R ├── 177-jquery-1 │ └── app.R ├── 131-renderplot-args │ └── app.R ├── 171-path-traversal │ └── app.R ├── 175-setInputValue │ └── script.js └── 163-select-factor │ └── app.R ├── 002-text ├── 002-text-golem │ ├── LICENSE │ ├── .gitignore │ ├── tests │ │ ├── testthat.R │ │ └── testthat │ │ │ └── test-golem-recommended.R │ ├── .Rbuildignore │ ├── inst │ │ └── app │ │ │ └── www │ │ │ └── favicon.ico │ ├── NAMESPACE │ ├── man │ │ └── run_app.Rd │ ├── R │ │ ├── run_app.R │ │ └── app_server.R │ ├── dev │ │ ├── run_dev.R │ │ └── 03_deploy.R │ ├── 002-text-golem.Rproj │ └── DESCRIPTION └── 002-text-original │ ├── DESCRIPTION │ └── Readme.md ├── 001-hello ├── 001-hello-golem │ ├── LICENSE │ ├── .gitignore │ ├── .Rbuildignore │ ├── inst │ │ └── app │ │ │ └── www │ │ │ └── favicon.ico │ ├── NAMESPACE │ ├── man │ │ └── run_app.Rd │ ├── R │ │ ├── run_app.R │ │ └── app_server.R │ ├── DESCRIPTION │ ├── dev │ │ ├── run_dev.R │ │ └── 03_deploy.R │ └── 001-hello-golem.Rproj ├── 001-hello-original │ ├── DESCRIPTION │ └── Readme.md └── readme.Rmd ├── 003-reactivity ├── 003-reactivity-golem │ ├── LICENSE │ ├── .gitignore │ ├── tests │ │ ├── testthat.R │ │ └── testthat │ │ │ └── test-golem-recommended.R │ ├── .Rbuildignore │ ├── inst │ │ └── app │ │ │ └── www │ │ │ └── favicon.ico │ ├── NAMESPACE │ ├── man │ │ └── run_app.Rd │ ├── R │ │ └── run_app.R │ ├── dev │ │ ├── run_dev.R │ │ └── 03_deploy.R │ ├── 003-reactivity-golem.Rproj │ └── DESCRIPTION └── 003-reactivity-original │ ├── DESCRIPTION │ └── Readme.md ├── shiny-dashboard ├── .DS_Store ├── shiny-dashboard-golem │ ├── .Rbuildignore │ ├── inst │ │ └── app │ │ │ └── www │ │ │ └── favicon.ico │ ├── NAMESPACE │ ├── man │ │ ├── app_ui.Rd │ │ └── run_app.Rd │ ├── R │ │ ├── app_server.R │ │ └── run_app.R │ ├── dev │ │ ├── run_dev.R │ │ └── 03_deploy.R │ ├── shiny-dashboard-golem.Rproj │ └── DESCRIPTION └── readme.md ├── 060-retirement-simulation ├── 060-retirement-simulation-golem │ ├── .Rbuildignore │ ├── data │ │ └── paramNames.rda │ ├── inst │ │ └── app │ │ │ └── www │ │ │ └── favicon.ico │ ├── NAMESPACE │ ├── man │ │ └── run_app.Rd │ ├── data-raw │ │ └── DATASET.R │ ├── R │ │ └── run_app.R │ ├── dev │ │ ├── run_dev.R │ │ └── 03_deploy.R │ ├── 060-retirement-simulation-golem.Rproj │ └── DESCRIPTION └── 060-retirement-simulation-original │ └── DESCRIPTION ├── golemize.Rproj └── README.md /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^README\.Rmd$ 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /shiny-examples-master/docker-rsc-deployer/.gitignore: -------------------------------------------------------------------------------- 1 | Applist.html -------------------------------------------------------------------------------- /shiny-examples-master/051-movie-explorer/.Renviron: -------------------------------------------------------------------------------- 1 | LANG="C.UTF-8" 2 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/src/outro.js: -------------------------------------------------------------------------------- 1 | })(); -------------------------------------------------------------------------------- /shiny-examples-master/096-plot-interaction-article-1/deps.R: -------------------------------------------------------------------------------- 1 | library(Cairo) 2 | -------------------------------------------------------------------------------- /shiny-examples-master/097-plot-interaction-article-2/deps.R: -------------------------------------------------------------------------------- 1 | library(Cairo) 2 | -------------------------------------------------------------------------------- /shiny-examples-master/098-plot-interaction-article-3/deps.R: -------------------------------------------------------------------------------- 1 | library(Cairo) 2 | -------------------------------------------------------------------------------- /shiny-examples-master/099-plot-interaction-article-4/deps.R: -------------------------------------------------------------------------------- 1 | library(Cairo) 2 | -------------------------------------------------------------------------------- /shiny-examples-master/100-plot-interaction-article-5/deps.R: -------------------------------------------------------------------------------- 1 | library(Cairo) 2 | -------------------------------------------------------------------------------- /shiny-examples-master/101-plot-interaction-article-6/deps.R: -------------------------------------------------------------------------------- 1 | library(Cairo) 2 | -------------------------------------------------------------------------------- /shiny-examples-master/102-plot-interaction-article-7/deps.R: -------------------------------------------------------------------------------- 1 | library(Cairo) 2 | -------------------------------------------------------------------------------- /shiny-examples-master/103-plot-interaction-article-8/deps.R: -------------------------------------------------------------------------------- 1 | library(Cairo) 2 | -------------------------------------------------------------------------------- /shiny-examples-master/169-prerender-a/js/log-rmd.js: -------------------------------------------------------------------------------- 1 | console.log("file 1") 2 | -------------------------------------------------------------------------------- /002-text/002-text-golem/LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2019 2 | COPYRIGHT HOLDER: RStudio, Inc. 3 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2019 2 | COPYRIGHT HOLDER: RStudio, Inc. 3 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/src/intro.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | -------------------------------------------------------------------------------- /shiny-examples-master/114-modal-dialog/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates modal dialogs. -------------------------------------------------------------------------------- /shiny-examples-master/015-layout-navbar/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /shiny-examples-master/136-plot-cache/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates basic plot caching. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/156-subapps/app3/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | } 3 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2019 2 | COPYRIGHT HOLDER: RStudio, Inc. 3 | -------------------------------------------------------------------------------- /shiny-examples-master/053-navlistpanel-example/server.r: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /002-text/002-text-golem/.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | inst/doc 6 | -------------------------------------------------------------------------------- /shiny-dashboard/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-dashboard/.DS_Store -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "asi": true 3 | } 4 | -------------------------------------------------------------------------------- /shiny-examples-master/107-events/Readme.md: -------------------------------------------------------------------------------- 1 | This app demonstrates the JavaScript events in Shiny. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/116-notifications/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates Shiny's notification system. -------------------------------------------------------------------------------- /001-hello/001-hello-golem/.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | inst/doc 6 | -------------------------------------------------------------------------------- /shiny-examples-master/156-subapps/app2/www/app2_styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: pink; 3 | } 4 | -------------------------------------------------------------------------------- /shiny-examples-master/086-bus-dashboard/metrotransit-data/.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | -------------------------------------------------------------------------------- /shiny-examples-master/111-insert-ui/README.md: -------------------------------------------------------------------------------- 1 | A simple app that inserts and removes elements using a queue logic. -------------------------------------------------------------------------------- /002-text/002-text-golem/tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(shinytext) 3 | 4 | test_check("shinytext") 5 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | inst/doc 6 | -------------------------------------------------------------------------------- /shiny-examples-master/048-including-html-text-and-markdown-files/server.r: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /shiny-examples-master/168-supporting-r-dir/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | counterButton("counter1", "Counter #1") 3 | ) 4 | -------------------------------------------------------------------------------- /shiny-examples-master/137-plot-cache-key/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates using multiple items in the plot cache key. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/113-bookmarking-url/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates bookmarking with the state encoded in the URL. 2 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(reactivity) 3 | 4 | test_check("reactivity") 5 | -------------------------------------------------------------------------------- /shiny-examples-master/156-subapps/app2/app.R: -------------------------------------------------------------------------------- 1 | server <- function(input, output, session) { 2 | } 3 | 4 | shinyApp(NULL, server) 5 | -------------------------------------------------------------------------------- /shiny-examples-master/168-supporting-r-dir/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | callModule(counter, "counter1") 3 | } 4 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^data-raw$ 4 | dev_history.R 5 | ^dev$ 6 | $run_dev.* -------------------------------------------------------------------------------- /shiny-examples-master/169-prerender-b/www/js/run-test.js: -------------------------------------------------------------------------------- 1 | $("#test-message") 2 | .text("Test passed :)") 3 | .css("color", "green"); 4 | -------------------------------------------------------------------------------- /shiny-examples-master/138-icon-fontawesome/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates using `icon` to create [FontAwesome](https://fontawesome.com/) icons. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/144-colors/countries.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/144-colors/countries.rds -------------------------------------------------------------------------------- /001-hello/001-hello-golem/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^data-raw$ 4 | dev_history.R 5 | ^dev$ 6 | $run_dev.* 7 | ^LICENSE\.md$ 8 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/inst/app/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/001-hello/001-hello-golem/inst/app/www/favicon.ico -------------------------------------------------------------------------------- /002-text/002-text-golem/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^data-raw$ 4 | dev_history.R 5 | ^dev$ 6 | $run_dev.* 7 | ^LICENSE\.md$ 8 | -------------------------------------------------------------------------------- /002-text/002-text-golem/inst/app/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/002-text/002-text-golem/inst/app/www/favicon.ico -------------------------------------------------------------------------------- /shiny-examples-master/051-movie-explorer/movies.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/051-movie-explorer/movies.db -------------------------------------------------------------------------------- /shiny-examples-master/082-word-cloud/romeo.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/082-word-cloud/romeo.txt.gz -------------------------------------------------------------------------------- /shiny-examples-master/082-word-cloud/summer.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/082-word-cloud/summer.txt.gz -------------------------------------------------------------------------------- /shiny-examples-master/082-word-cloud/merchant.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/082-word-cloud/merchant.txt.gz -------------------------------------------------------------------------------- /shiny-examples-master/082-word-cloud/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/082-word-cloud/screenshot.png -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^data-raw$ 4 | dev_history.R 5 | ^dev$ 6 | $run_dev.* 7 | ^LICENSE\.md$ 8 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^data-raw$ 4 | dev_history.R 5 | ^dev$ 6 | $run_dev.* -------------------------------------------------------------------------------- /shiny-examples-master/047-image-output/images/face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/047-image-output/images/face.png -------------------------------------------------------------------------------- /shiny-examples-master/053-navlistpanel-example/README.md: -------------------------------------------------------------------------------- 1 | A `navlistPanel` is like a `tabPanel`, except that the navigation links are on the left instead of the top. -------------------------------------------------------------------------------- /shiny-examples-master/084-single-file/README.md: -------------------------------------------------------------------------------- 1 | This example shows how to make an app with a single file, app.R, instead of using the two files server.R and ui.R. 2 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/inst/app/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/003-reactivity/003-reactivity-golem/inst/app/www/favicon.ico -------------------------------------------------------------------------------- /shiny-examples-master/047-image-output/images/chainring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/047-image-output/images/chainring.jpg -------------------------------------------------------------------------------- /shiny-examples-master/063-superzip-example/data/superzip.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/063-superzip-example/data/superzip.rds -------------------------------------------------------------------------------- /shiny-examples-master/081-widgets-gallery/www/texturebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/081-widgets-gallery/www/texturebg.png -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/inst/app/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-dashboard/shiny-dashboard-golem/inst/app/www/favicon.ico -------------------------------------------------------------------------------- /shiny-examples-master/082-word-cloud/README.md: -------------------------------------------------------------------------------- 1 | A simple word cloud generator, based on [this blog post](http://pirategrunt.com/2013/12/11/24-days-of-r-day-11/) by PirateGrunt. -------------------------------------------------------------------------------- /shiny-examples-master/015-layout-navbar/ui.R: -------------------------------------------------------------------------------- 1 | navbarPage( 2 | "My Application", 3 | tabPanel("Component 1"), 4 | tabPanel("Component 2"), 5 | tabPanel("Component 3") 6 | ) 7 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/global.R: -------------------------------------------------------------------------------- 1 | # Any code in this file is guaranteed to be called before either 2 | # ui.R or server.R 3 | 4 | source("linechart.R") 5 | -------------------------------------------------------------------------------- /shiny-examples-master/067-vertical-layout/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | output$plot1 <- renderPlot({ 3 | plot(x = rnorm(input$n), y = rnorm(input$n)) 4 | }) 5 | } 6 | -------------------------------------------------------------------------------- /shiny-examples-master/036-custom-input-control/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | output$selection <- renderPrint( 4 | input$mychooser 5 | ) 6 | 7 | } 8 | -------------------------------------------------------------------------------- /shiny-examples-master/154-index-html-server-r/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | output$status <- renderPrint({ 3 | tags$b("pass", style = "color: green;") 4 | }) 5 | } 6 | -------------------------------------------------------------------------------- /shiny-examples-master/167-resource-warnings/www/images/rstudio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/167-resource-warnings/www/images/rstudio.png -------------------------------------------------------------------------------- /002-text/002-text-golem/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(run_app) 4 | import(shiny) 5 | importFrom(golem,with_golem_options) 6 | importFrom(shiny,shinyApp) 7 | -------------------------------------------------------------------------------- /shiny-examples-master/020-knit-html/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: knit html 2 | Author: Yihui Xie 3 | AuthorUrl: http://yihui.name 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: knitr 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/039-download-file/README.md: -------------------------------------------------------------------------------- 1 | To create file download button, there should be a `downloadButton` on the client side, and a corresponding `downloadHandler` on the server side. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/081-widgets-gallery/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Widget Gallery 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | Type: Shiny 7 | -------------------------------------------------------------------------------- /shiny-examples-master/086-bus-dashboard/metrotransit-data/rds/shapes.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/086-bus-dashboard/metrotransit-data/rds/shapes.rds -------------------------------------------------------------------------------- /shiny-examples-master/086-bus-dashboard/metrotransit-data/rds/trips.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/086-bus-dashboard/metrotransit-data/rds/trips.rds -------------------------------------------------------------------------------- /shiny-examples-master/165-trailing-comma/Readme.md: -------------------------------------------------------------------------------- 1 | This app has a trailing comma in the UI. Historically, that would have crashed the app. But as of htmltools `0.3.6.9004`, that's now allowed. 2 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(run_app) 4 | import(shiny) 5 | importFrom(golem,with_golem_options) 6 | importFrom(shiny,shinyApp) 7 | -------------------------------------------------------------------------------- /shiny-examples-master/010-download/Readme.md: -------------------------------------------------------------------------------- 1 | We can add a download button to the UI using `downloadButton()`, and write 2 | the content of the file in `downloadHandler()` in the `server` function. 3 | -------------------------------------------------------------------------------- /shiny-examples-master/083-front-page/README.md: -------------------------------------------------------------------------------- 1 | A simple Shiny app that displays eruption data for the Old Faithful geyser. Featured on the front page of the [Shiny Dev Center](http://shiny.rstudio.com). -------------------------------------------------------------------------------- /shiny-examples-master/164-no-whitespace/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: No Whitespace 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Type: Shiny 7 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/data/paramNames.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/060-retirement-simulation/060-retirement-simulation-golem/data/paramNames.rda -------------------------------------------------------------------------------- /shiny-examples-master/019-mathjax/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: MathJax 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: MathJax 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/026-shiny-inline/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Inline Output 2 | Author: Yihui Xie 3 | AuthorUrl: http://yihui.name 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: inline 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/080-widget-text/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Text Input 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(run_app) 4 | import(shiny) 5 | importFrom(golem,with_golem_options) 6 | importFrom(shiny,shinyApp) 7 | -------------------------------------------------------------------------------- /shiny-examples-master/011-timer/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Timer 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/017-select-vs-selectize/Readme.md: -------------------------------------------------------------------------------- 1 | This app shows a side-by-side comparison of select and selectize input 2 | elements, i.e. `selectInput(..., selectize = FALSE)` vs `selectizeInput(...)`. 3 | -------------------------------------------------------------------------------- /shiny-examples-master/022-unicode-chinese/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Unicode characters 2 | Author: 谢益辉 3 | AuthorUrl: http://yihui.name 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: unicode 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/070-widget-checkbox/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Checkbox 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/071-widget-date/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Date Selector 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/071-widget-date/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget with input$date, e.g. 4 | output$value <- renderPrint({ input$date }) 5 | 6 | } 7 | -------------------------------------------------------------------------------- /shiny-examples-master/074-widget-numeric/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget with input$num, e.g. 4 | output$value <- renderPrint({ input$num }) 5 | 6 | } 7 | -------------------------------------------------------------------------------- /shiny-examples-master/075-widget-radio/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Radio Buttons 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/076-widget-select/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Select Box 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/079-widget-submit/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Submit Button 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/080-widget-text/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget with input$text, e.g. 4 | output$value <- renderPrint({ input$text }) 5 | 6 | } 7 | -------------------------------------------------------------------------------- /shiny-examples-master/086-bus-dashboard/dependencies.R: -------------------------------------------------------------------------------- 1 | # This is needed because the shinyapps dependency detection doesn't realize 2 | # that jsonlite::fromJSON needs httr when using URLs. 3 | library(httr) 4 | -------------------------------------------------------------------------------- /shiny-examples-master/109-render-table/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Table Demo App 3 | Author: Bárbara Borges 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | DisplayMode: Normal 7 | Tags: outputs -------------------------------------------------------------------------------- /shiny-examples-master/111-insert-ui/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: insertUI and removeUI - Queue demo 3 | Author: Bárbara Borges 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | DisplayMode: Showcase -------------------------------------------------------------------------------- /shiny-examples-master/111-insert-ui/ui.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | fluidPage( 4 | actionButton('insertBtn', 'Insert'), 5 | actionButton('removeBtn', 'Remove'), 6 | tags$div(id = 'placeholder') 7 | ) 8 | -------------------------------------------------------------------------------- /shiny-examples-master/120-goog-index/README.md: -------------------------------------------------------------------------------- 1 | A simple Shiny app that displays eruption data for the Google Trend Index app. Featured on the front page of the [Shiny Dev Center](http://shiny.rstudio.com). 2 | -------------------------------------------------------------------------------- /shiny-examples-master/156-subapps/app3/ui.R: -------------------------------------------------------------------------------- 1 | library(leaflet) 2 | 3 | tagList( 4 | leaflet(width="100%", height="100%") %>% addTiles(), 5 | tags$style("html, body { width: 100%; height: 100%; }") 6 | ) 7 | -------------------------------------------------------------------------------- /shiny-examples-master/165-trailing-comma/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Trailing commas in the UI 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Type: Shiny 7 | -------------------------------------------------------------------------------- /001-hello/001-hello-original/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Hello Shiny! 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /002-text/002-text-original/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Shiny Text 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | 9 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/inst/app/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/060-retirement-simulation/060-retirement-simulation-golem/inst/app/www/favicon.ico -------------------------------------------------------------------------------- /shiny-examples-master/005-sliders/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Sliders 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/006-tabsets/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Tabsets 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/007-widgets/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Widgets 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/008-html/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Custom HTML UI 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/009-upload/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: File Upload 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/014-onflushed/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: onFlush Example 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: flush 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/025-loop-ui/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Creating a UI from a loop 2 | Author: Yihui Xie 3 | AuthorUrl: http://yihui.name 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: dynamic-ui 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/066-upload-file/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Upload File 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: file-upload 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/073-widget-file/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: File Upload widget 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/074-widget-numeric/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Number Selector 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/076-widget-select/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget with input$select, e.g. 4 | output$value <- renderPrint({ input$select }) 5 | 6 | } 7 | -------------------------------------------------------------------------------- /shiny-examples-master/083-front-page/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Faithful 2 | Author: RStudio 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/114-modal-dialog/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Modal dialogs 3 | Author: Winston Chang 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | Tags: modal 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-original/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Reactivity 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/004-mpg/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Miles Per Gallon 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/010-download/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: File Download 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: getting-started 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/012-datatables/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: DataTables Demo 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: datatables 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/013-selectize/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Selectize Examples 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: selectize 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/063-superzip-example/data/-revisedmurrayfile_111952895138.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/063-superzip-example/data/-revisedmurrayfile_111952895138.xls -------------------------------------------------------------------------------- /shiny-examples-master/068-widget-action-button/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Action Button 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/069-widget-check-group/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Checkbox Group 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/070-widget-checkbox/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget with input$checkbox, e.g. 4 | output$value <- renderPrint({ input$checkbox }) 5 | 6 | } 7 | -------------------------------------------------------------------------------- /shiny-examples-master/072-widget-date-range/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Date Range Selector 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/108-module-output/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Module example 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: modules 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/110-error-sanitization/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Error Hiding Demo 3 | Author: Bárbara Borges 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | DisplayMode: Normal 7 | Tags: outputs -------------------------------------------------------------------------------- /shiny-examples-master/117-shinythemes/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Shiny theme selector 3 | Author: Winston Chang 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | Tags: themes 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/155-index-html-app-r/app.R: -------------------------------------------------------------------------------- 1 | server <- function(input, output) { 2 | output$status <- renderPrint({ 3 | tags$b("pass", style = "color: green;") 4 | }) 5 | } 6 | 7 | shinyApp(NULL, server) 8 | -------------------------------------------------------------------------------- /shiny-examples-master/015-layout-navbar/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Navbar Layout 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: layout navbar 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/015-layout-sidebar/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Sidebar Layout 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: layout sidebar 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/039-download-file/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Download File 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: file-download 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/051-movie-explorer/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Movie explorer 2 | Author: Winston Chang 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Type: Shiny 6 | Tags: ggvis sliderinput 7 | -------------------------------------------------------------------------------- /shiny-examples-master/052-navbar-example/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Navbar Example 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: navbar layout 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/examples/images/grey-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/examples/images/grey-plus.png -------------------------------------------------------------------------------- /shiny-examples-master/068-widget-action-button/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget with input$action, e.g. 4 | output$value <- renderPrint({ input$action }) 5 | 6 | } 7 | -------------------------------------------------------------------------------- /shiny-examples-master/077-widget-slider/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Slider Bar and Slider Range 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Tags: widgets 6 | DisplayMode: Showcase 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/084-single-file/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Single-file shiny app 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: single-file 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/107-events/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: JavaScript Events in Shiny 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: JavaScript 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/112-generate-report/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Generating reports 3 | Author: Winston Chang 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | Tags: reports 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/113-bookmarking-url/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Bookmarking - URL 3 | Author: Winston Chang 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | Tags: bookmarking 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/115-bookmarking-updatequerystring/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates bookmarking with the state encoded in the URL, and updates the browser's location bar automatically each time an input value changes. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/116-notifications/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Notifications 3 | Author: Winston Chang 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | Tags: notifications 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/136-plot-cache/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Plot caching - basic 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: plot-cache 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/168-supporting-r-dir/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Automatically Load Supporting R files 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Type: Shiny 7 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(run_app) 4 | import(shiny) 5 | importFrom(golem,with_golem_options) 6 | importFrom(shiny,shinyApp) 7 | -------------------------------------------------------------------------------- /shiny-examples-master/009-upload/Readme.md: -------------------------------------------------------------------------------- 1 | We can add a file upload input in the UI using the function `fileInput()`, 2 | e.g. `fileInput('foo')`. In the `server` function, we can access the 3 | uploaded files via `input$foo`. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/018-datatable-options/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: DataTables Options 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: DataTables 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/examples/images/grey-minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/examples/images/grey-minus.png -------------------------------------------------------------------------------- /shiny-examples-master/073-widget-file/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget with input$file, e.g. 4 | output$value <- renderPrint({ 5 | str(input$file) 6 | }) 7 | 8 | } 9 | -------------------------------------------------------------------------------- /shiny-examples-master/078-widget-slider-range/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Slider Range 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: widgets slider 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/085-progress/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | Type: Shiny 3 | Title: Progress bar example 4 | Author: RStudio, Inc. 5 | AuthorUrl: http://www.rstudio.com/ 6 | License: MIT 7 | Tags: 8 | DisplayMode: Showcase 9 | -------------------------------------------------------------------------------- /shiny-examples-master/086-bus-dashboard/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | Type: Shiny 3 | Title: Bus dashboard example 4 | Author: RStudio, Inc. 5 | AuthorUrl: http://www.rstudio.com/ 6 | License: MIT 7 | Tags: 8 | DisplayMode: Normal 9 | -------------------------------------------------------------------------------- /shiny-examples-master/137-plot-cache-key/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Plot caching - data key 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: plot-cache 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/138-icon-fontawesome/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: FontAwesome icons 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: fontawesome 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(run_app) 4 | import(shiny) 5 | import(shinydashboard) 6 | importFrom(golem,with_golem_options) 7 | importFrom(shiny,shinyApp) 8 | -------------------------------------------------------------------------------- /shiny-examples-master/021-selectize-plot/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Selectize rendering methods 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: selectize 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/023-optgroup-server/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Option groups for server-side selectize 2 | Author: Yihui Xie 3 | AuthorUrl: http://yihui.name 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: selectize 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/024-optgroup-selectize/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Option groups for selectize input 2 | Author: Yihui Xie 3 | AuthorUrl: http://yihui.name 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: selectize 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/033-conditionalpanel-demo/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | output$scatterPlot <- renderPlot({ 4 | x <- rnorm(input$n) 5 | y <- rnorm(input$n) 6 | plot(x, y) 7 | }) 8 | 9 | } 10 | -------------------------------------------------------------------------------- /shiny-examples-master/034-current-time/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Current Time 2 | Author: Joe Cheng 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: invalidatelater 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/049-isolate-demo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: isolate demo 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: isolate 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/075-widget-radio/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the values of the widget (as a vector) 4 | # with input$radio, e.g. 5 | output$value <- renderPrint({ input$radio }) 6 | 7 | } 8 | -------------------------------------------------------------------------------- /shiny-examples-master/088-action-pattern1/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Action Button - Pattern 1 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: action-button 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/089-action-pattern2/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Action Button - Pattern 2 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: action-button 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/090-action-pattern3/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Action Button - Pattern 3 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: action-button 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/091-action-pattern4/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Action Button - Pattern 4 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: action-button 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/092-action-pattern5/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Action Button - Pattern 5 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: action-button 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/016-knitr-pdf/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Download knitr Reports 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: download knitr rmarkdown 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/055-observer-demo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Observer demo 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: observer 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/087-crandash/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | Type: Shiny 3 | Title: Streaming CRAN data example 4 | Author: Joe Cheng 5 | AuthorUrl: http://www.rstudio.com/ 6 | License: MIT 7 | Tags: streaming 8 | DisplayMode: Normal 9 | -------------------------------------------------------------------------------- /shiny-examples-master/093-plot-interaction-basic/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates basic plot interactions, with both base graphics and ggplot2. 2 | 3 | The four types of interactions are: clicking, double-clicking, hovering, and brushing. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/005-sliders/Readme.md: -------------------------------------------------------------------------------- 1 | This example demonstrates Shiny's versatile `sliderInput` widget. 2 | 3 | Slider inputs can be used to select single values, to select a continuous range of values, and even to animate over a range. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/017-select-vs-selectize/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Selectize vs. Select 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: selectinput selectize 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/028-actionbutton-demo/README.md: -------------------------------------------------------------------------------- 1 | Action buttons should always be used with one of `eventReactive()` or `observeEvent()`. See the article [Using Action Buttons](http://shiny.rstudio.com/articles/action-buttons.html) for details. -------------------------------------------------------------------------------- /shiny-examples-master/047-image-output/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Image output 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: image-output 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/063-superzip-example/data/deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget http://notebook.gaslampmedia.com/wp-content/uploads/2013/08/zip_codes_states.csv 4 | wget http://www.aei.org/files/2012/02/16/-revisedmurrayfile_111952895138.xls 5 | -------------------------------------------------------------------------------- /shiny-examples-master/093-plot-interaction-basic/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Plot interaction - basic 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: plot-interaction 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/105-plot-interaction-zoom/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Plot interaction - zoom 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: plot-interaction 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/169-prerender-a/index.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Test passed, move along!" 3 | output: html_document 4 | runtime: shiny_prerendered 5 | --- 6 | 7 | ```{r, echo = FALSE} 8 | tags$script(src = "js/log-rmd.js") 9 | ``` 10 | -------------------------------------------------------------------------------- /shiny-examples-master/014-onflushed/ui.R: -------------------------------------------------------------------------------- 1 | basicPage( 2 | h2('Immediate output here'), 3 | verbatimTextOutput('fast'), 4 | h2('Delayed output comes after the page is ready'), 5 | verbatimTextOutput('slow'), 6 | plotOutput('slow_plot') 7 | ) 8 | -------------------------------------------------------------------------------- /shiny-examples-master/028-actionbutton-demo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: actionButton demo 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: actionbutton 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/examples/images/nvd3_sampleLineChart1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinFay/golemize/HEAD/shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/examples/images/nvd3_sampleLineChart1.png -------------------------------------------------------------------------------- /shiny-examples-master/062-submitbutton-demo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: submitButton demo 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: submitbutton 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/065-update-input-demo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Update input demo 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: updateinput 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/069-widget-check-group/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the values of the widget (as a vector) 4 | # with input$checkGroup, e.g. 5 | output$value <- renderPrint({ input$checkGroup }) 6 | 7 | } 8 | -------------------------------------------------------------------------------- /shiny-examples-master/072-widget-date-range/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the values of the widget (as a vector of Dates) 4 | # with input$dates, e.g. 5 | output$value <- renderPrint({ input$dates }) 6 | 7 | } 8 | -------------------------------------------------------------------------------- /shiny-examples-master/094-image-interaction-basic/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Image interaction - basic 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: plot-interaction 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/095-plot-interaction-advanced/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Plot interaction - advanced 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: plot-interaction 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: NVD3 line chart output 2 | Author: Joe Cheng 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Type: Shiny 6 | Tags: custom-output nvd3 d3 javascript 7 | 8 | -------------------------------------------------------------------------------- /shiny-examples-master/067-vertical-layout/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Vertical Layout 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: vertical-layout 7 | DisplayMode: Showcase 8 | 9 | -------------------------------------------------------------------------------- /shiny-examples-master/120-goog-index/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Google Trend Index 3 | License: MIT 4 | Author: Mine Cetinkaya-Rundel 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: getting-started 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/030-basic-datatable/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Basic DataTable 2 | Author: Jeff Allen 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: mtcars selectinput datatables 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/036-custom-input-control/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Custom input control 2 | Author: Joe Cheng 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | Type: Shiny 6 | Tags: javascript custom-input 7 | DisplayMode: Normal 8 | -------------------------------------------------------------------------------- /shiny-examples-master/037-date-and-date-range/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Date and date range 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: date, daterange 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/041-dynamic-ui/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Dynamic UI 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: dynamic-ui renderui uioutput 7 | DisplayMode: Showcase 8 | 9 | -------------------------------------------------------------------------------- /shiny-examples-master/053-navlistpanel-example/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: navlistPanel example 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: navlistpanel 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/062-submitbutton-demo/server.r: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | output$plot1 <- renderPlot({ 3 | hist(rnorm(input$n)) 4 | }) 5 | 6 | output$text <- renderText({ 7 | paste("Input text is:", input$text) 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /shiny-examples-master/078-widget-slider-range/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget (as a vector of length 2) 4 | # with input$slider2, e.g. 5 | output$value <- renderPrint({ input$slider2 }) 6 | 7 | } 8 | -------------------------------------------------------------------------------- /shiny-examples-master/104-plot-interaction-select/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Plot interaction - selecting points 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: plot-interaction 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/106-plot-interaction-exclude/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Plot interaction - excluding points 2 | Author: RStudio, Inc. 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: plot-interaction 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/115-bookmarking-updatequerystring/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Bookmarking with updateQueryString 3 | Author: Winston Chang 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | Tags: bookmarking 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/118-highcharter-births/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: The Friday the 13th effect 3 | Author: Mine Cetinkaya-Rundel 4 | AuthorUrl: http://www.rstudio.com/ 5 | License: MIT 6 | Tags: highcharter, highcharts 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/033-conditionalpanel-demo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: conditionalPanel demo 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: conditionalpanel 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/docker/shiny-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Make sure the directory for individual app logs exists 4 | mkdir -p /var/log/shiny-server 5 | chown shiny.shiny /var/log/shiny-server 6 | 7 | exec shiny-server >> /var/log/shiny-server.log 2>&1 8 | -------------------------------------------------------------------------------- /shiny-examples-master/035-custom-input-bindings/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Custom input bindings 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: custom-input-binding 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/040-dynamic-clustering/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Dynamic Clustering 2 | Author: Jeff Allen 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: mclust clustering clickid observe isolate 7 | Type: Shiny -------------------------------------------------------------------------------- /shiny-examples-master/057-plot-plus-three-columns/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Plot plus three columns 2 | Author: JJ Allaire 3 | AuthorUrl: http://www.rstudio.com/ 4 | Type: Shiny 5 | License: MIT 6 | DisplayMode: Showcase 7 | Tags: application-layout ggplot2 8 | -------------------------------------------------------------------------------- /shiny-examples-master/063-superzip-example/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: SuperZip example 2 | License: MIT 3 | DisplayMode: Normal 4 | Author: Joe Cheng 5 | AuthorUrl: http://www.rstudio.com/ 6 | Type: Shiny 7 | Tags: leaflet selectize datatables absolutepanel 8 | -------------------------------------------------------------------------------- /shiny-examples-master/068-widget-action-button/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make an action button 4 | actionButton("action", label = "Action"), 5 | 6 | hr(), 7 | fluidRow(column(2, verbatimTextOutput("value"))) 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shiny-examples-master/073-widget-file/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a file upload manager 4 | fileInput("file", label = h3("File input")), 5 | 6 | hr(), 7 | fluidRow(column(4, verbatimTextOutput("value"))) 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shiny-examples-master/082-word-cloud/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Word cloud 2 | Author: Fereshteh Karimeddini 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: wordcloud text-mining actionbutton 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/104-plot-interaction-select/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates two ways of selecting points. 2 | 3 | The first way is to use `nearPoints()` with the click input object. 4 | 5 | The second way is to use `brushedPoints()` with the brush input object. 6 | -------------------------------------------------------------------------------- /002-text/002-text-original/Readme.md: -------------------------------------------------------------------------------- 1 | This example demonstrates output of raw text from R using the `renderPrint` function in `server` and the `verbatimTextOutput` function in `ui`. In this case, a textual summary of the data is shown using R's built-in `summary` function. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/036-custom-input-control/ui.R: -------------------------------------------------------------------------------- 1 | source("chooser.R") 2 | 3 | fluidPage( 4 | chooserInput("mychooser", "Available frobs", "Selected frobs", 5 | row.names(USArrests), c(), size = 10, multiple = TRUE 6 | ), 7 | verbatimTextOutput("selection") 8 | ) -------------------------------------------------------------------------------- /shiny-examples-master/064-telephones-by-region/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Telephones by region 2 | Author: Jeff Allen 3 | AuthorUrl: http://www.rstudio.com/ 4 | License: MIT 5 | DisplayMode: Showcase 6 | Tags: sidebarlayout helptext selectinput 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/027-absolutely-positioned-panels/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Absolutely-positioned panels 2 | Type: Shiny 3 | Author: Joe Cheng 4 | AuthorUrl: http://www.rstudio.com/ 5 | Tags: absolutePanel css markdown 6 | License: MIT 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/061-server-to-client-custom-messages/www/message-handler.js: -------------------------------------------------------------------------------- 1 | // This recieves messages of type "testmessage" from the server. 2 | Shiny.addCustomMessageHandler("testmessage", 3 | function(message) { 4 | alert(JSON.stringify(message)); 5 | } 6 | ); 7 | -------------------------------------------------------------------------------- /shiny-examples-master/070-widget-checkbox/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a checkbox 4 | checkboxInput("checkbox", label = "Choice A", value = TRUE), 5 | 6 | hr(), 7 | fluidRow(column(3, verbatimTextOutput("value"))) 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shiny-examples-master/072-widget-date-range/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a date range selector 4 | dateRangeInput("dates", label = h3("Date range")), 5 | 6 | hr(), 7 | fluidRow(column(4, verbatimTextOutput("value"))) 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shiny-examples-master/119-namespaced-conditionalpanel-demo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Namespaced conditionalPanel demo 3 | License: MIT 4 | Author: Alan Dipert 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: conditionalpanel 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /golemize.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/032-client-data-and-query-string/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Client data and query string 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: clientdata query-string 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/067-vertical-layout/README.md: -------------------------------------------------------------------------------- 1 | Each item passed to `verticalLayout()` will occupy a row. This is similar to `fluidRow()`, except that `fluidRow()` expects there to be one or more `column()`s inside, whereas `vertcialLayout()` does not; each item takes a full row. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/048-including-html-text-and-markdown-files/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Including HTML, text, and Markdown files 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: include 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/052-navbar-example/about.md: -------------------------------------------------------------------------------- 1 | ### Speed and Stopping Distances of Cars 2 | 3 | The data give the speed of cars and the distances taken to stop. Note that the data were recorded in the 1920s. 4 | 5 | * **Speed** - speed (mph) 6 | * **Dist** - stopping distance (ft) 7 | -------------------------------------------------------------------------------- /shiny-examples-master/061-server-to-client-custom-messages/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Server-to-client custom messages 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: send-custom-message 7 | DisplayMode: Showcase 8 | -------------------------------------------------------------------------------- /shiny-examples-master/071-widget-date/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a date selector 4 | dateInput("date", label = h3("Date input"), value = "2014-01-01"), 5 | 6 | hr(), 7 | fluidRow(column(3, verbatimTextOutput("value"))) 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shiny-examples-master/050-kmeans-example/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Kmeans example 2 | License: MIT 3 | Author: Joe Cheng 4 | AuthorUrl: http://www.rstudio.com/ 5 | Tags: getting-started kmeans plotoutput sliderinput numericinput reactivity 6 | DisplayMode: Showcase 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy src\intro.js /B + src\core.js /B + src\tooltip.js /B temp1.js /B 3 | copy src\models\*.js /B temp2.js /B 4 | copy temp1.js /B + temp2.js /B + src\outro.js /B nv.d3.js /B 5 | del temp1.js 6 | del temp2.js 7 | -------------------------------------------------------------------------------- /shiny-examples-master/080-widget-text/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a text input box 4 | textInput("text", label = h3("Text input"), value = "Enter text..."), 5 | 6 | hr(), 7 | fluidRow(column(3, verbatimTextOutput("value"))) 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shiny-examples-master/008-html/Readme.md: -------------------------------------------------------------------------------- 1 | Normally we use the built-in functions, such as `textInput()`, to generate the HTML UI in the R script `ui.R`. Actually **shiny** also works with a custom HTML page `www/index.html`. See [the tutorial](http://shiny.rstudio.com/tutorial/) for more details. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/011-timer/Readme.md: -------------------------------------------------------------------------------- 1 | The function `invalidateLater()` can be used to invalidate an observer or 2 | reactive expression in a given number of milliseconds. In this example, the 3 | output `currentTime` is updated every second, so it shows the current time 4 | on a second basis. 5 | -------------------------------------------------------------------------------- /shiny-examples-master/074-widget-numeric/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a number input box into the UI. 4 | numericInput("num", label = h3("Numeric input"), value = 1), 5 | 6 | hr(), 7 | fluidRow(column(3, verbatimTextOutput("value"))) 8 | 9 | ) 10 | -------------------------------------------------------------------------------- /shiny-examples-master/059-reactive-poll-and-file-reader/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Shiny 2 | Title: Reactive poll and file reader 3 | License: MIT 4 | Author: Winston Chang 5 | AuthorUrl: http://www.rstudio.com/ 6 | Tags: reactive-poll reactive-file-reader 7 | DisplayMode: Showcase 8 | 9 | -------------------------------------------------------------------------------- /002-text/002-text-golem/man/run_app.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_app.R 3 | \name{run_app} 4 | \alias{run_app} 5 | \title{Run the Shiny Application} 6 | \usage{ 7 | run_app(...) 8 | } 9 | \description{ 10 | Run the Shiny Application 11 | } 12 | -------------------------------------------------------------------------------- /shiny-examples-master/085-progress/ui.R: -------------------------------------------------------------------------------- 1 | basicPage( 2 | plotOutput('plot', width = "300px", height = "300px"), 3 | tableOutput('table'), 4 | radioButtons('style', 'Progress bar style', c('notification', 'old')), 5 | actionButton('goPlot', 'Go plot'), 6 | actionButton('goTable', 'Go table') 7 | ) 8 | -------------------------------------------------------------------------------- /shiny-examples-master/105-plot-interaction-zoom/README.md: -------------------------------------------------------------------------------- 1 | The plot on the left can be zoomed in by drawing a brush and then double-clicking on the brush. 2 | 3 | The middle and right plots are linked: when you draw a brush on the middle plot, the right plot will automatically zoom to the brush's dimensions. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/164-no-whitespace/Readme.md: -------------------------------------------------------------------------------- 1 | This small Shiny application demonstrates how to suppress whitespace between HTML tags. 2 | 3 | The .noWS argument can be specified when specifying a tag to suppress whitespace in or around it. 4 | 5 | Note this feature requires **htmltools** >= 0.3.6.9004. 6 | -------------------------------------------------------------------------------- /shiny-examples-master/066-upload-file/README.md: -------------------------------------------------------------------------------- 1 | We can add a file upload input in the UI using the function `fileInput()`, 2 | e.g. `fileInput('foo')`. In `server.R`, we can access the uploaded files via 3 | `input$foo`. See [the 4 | tutorial](http://rstudio.github.io/shiny/tutorial/#uploads) for more details. 5 | -------------------------------------------------------------------------------- /shiny-examples-master/067-vertical-layout/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | verticalLayout( 3 | titlePanel("Vertical layout example"), 4 | plotOutput("plot1"), 5 | wellPanel( 6 | sliderInput("n", "Number of points", 10, 200, 7 | value = 50, step = 10) 8 | ) 9 | ) 10 | ) 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # golemize 2 | 3 | A series of classic Shiny Apps turned to `{golem}` app. 4 | 5 | Each sub-repo has its own README detailing the process. 6 | 7 | The folders starting with number and dash are the one from [github.com/rstudio/shiny-examples](http://github.com/rstudio/shiny-examples) 8 | 9 | 10 | -------------------------------------------------------------------------------- /shiny-examples-master/016-knitr-pdf/Readme.md: -------------------------------------------------------------------------------- 1 | This app uses the **rmarkdown** package to compile a report template to PDF/HTML/Word, 2 | which we can download by clicking a button. Note we switched the working dir 3 | to a temporary dir, to avoid the possibility that we do not have write 4 | permission on the server. 5 | -------------------------------------------------------------------------------- /shiny-examples-master/079-widget-submit/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # submit buttons do not have a value of their own, 4 | # they control when the app accesses values of other widgets. 5 | # input$num is the value of the number widget. 6 | output$value <- renderPrint({ input$num }) 7 | 8 | } 9 | -------------------------------------------------------------------------------- /shiny-examples-master/083-front-page/front-page.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/085-progress/README.md: -------------------------------------------------------------------------------- 1 | This example shows two ways to add progress bars to an app. 2 | 3 | One method is to use `withProgress()`, and another is to create a `Progress` object using `shiny::Progress$new()`. The latter allows finer control over the progress bar, but it is a bit more complicated to use. -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/man/run_app.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_app.R 3 | \name{run_app} 4 | \alias{run_app} 5 | \title{Run the Shiny Application} 6 | \usage{ 7 | run_app(...) 8 | } 9 | \description{ 10 | Run the Shiny Application 11 | } 12 | -------------------------------------------------------------------------------- /shiny-examples-master/013-selectize/Readme.md: -------------------------------------------------------------------------------- 1 | The function `selectizeInput()` creates a select input extended by 2 | [selectize.js](https://github.com/brianreavis/selectize.js). You can type and 3 | search in the input box, delete selected items, set placeholders, and add new 4 | options by typing in the input box, etc. 5 | -------------------------------------------------------------------------------- /shiny-examples-master/081-widgets-gallery/widgets.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/output.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/079-widget-submit/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | numericInput("num", label = "Make changes", value = 1), 4 | 5 | # Copy the line below to place a submit into the UI. 6 | submitButton("Apply Changes"), 7 | 8 | hr(), 9 | fluidRow(column(3, verbatimTextOutput("value"))) 10 | 11 | ) 12 | -------------------------------------------------------------------------------- /001-hello/001-hello-original/Readme.md: -------------------------------------------------------------------------------- 1 | This small Shiny application demonstrates Shiny's automatic UI updates. 2 | 3 | Move the *Number of bins* slider and notice how the `renderPlot` expression is automatically re-evaluated when its dependant, `input$bins`, changes, causing a histogram with a new number of bins to be rendered. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/007-widgets/Readme.md: -------------------------------------------------------------------------------- 1 | This example demonstrates some additional widgets included in Shiny, such as `helpText` and `actionButton`. The latter is used to delay rendering output until the user explicitly requests it (a construct which also introduces two important server functions, `eventReactive` and `isolate`). 2 | -------------------------------------------------------------------------------- /shiny-examples-master/066-upload-file/www/pressure.tsv: -------------------------------------------------------------------------------- 1 | "temperature" "pressure" 2 | 0 2e-04 3 | 20 0.0012 4 | 40 0.006 5 | 60 0.03 6 | 80 0.09 7 | 100 0.27 8 | 120 0.75 9 | 140 1.85 10 | 160 4.2 11 | 180 8.8 12 | 200 17.3 13 | 220 32.1 14 | 240 57 15 | 260 96 16 | 280 157 17 | 300 247 18 | 320 376 19 | 340 558 20 | 360 806 21 | -------------------------------------------------------------------------------- /shiny-examples-master/068-widget-action-button/action-button.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/088-action-pattern1/088-action-pattern1.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/089-action-pattern2/089-action-pattern2.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/090-action-pattern3/090-action-pattern3.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/091-action-pattern4/091-action-pattern4.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /shiny-examples-master/092-action-pattern5/092-action-pattern5.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /002-text/002-text-golem/R/run_app.R: -------------------------------------------------------------------------------- 1 | #' Run the Shiny Application 2 | #' 3 | #' @export 4 | #' @importFrom shiny shinyApp 5 | #' @importFrom golem with_golem_options 6 | run_app <- function(...) { 7 | with_golem_options( 8 | app = shinyApp(ui = app_ui, server = app_server), 9 | golem_opts = list(...) 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /shiny-examples-master/078-widget-slider-range/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a slider bar with a range 4 | sliderInput("slider2", label = h3("Slider Range"), min = 0, max = 100, 5 | value = c(25, 75)), 6 | 7 | hr(), 8 | fluidRow(column(3, verbatimTextOutput("value"))) 9 | 10 | ) 11 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/man/run_app.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_app.R 3 | \name{run_app} 4 | \alias{run_app} 5 | \title{Run the Shiny Application} 6 | \usage{ 7 | run_app(...) 8 | } 9 | \description{ 10 | Run the Shiny Application 11 | } 12 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/man/app_ui.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/app_ui.R 3 | \name{app_ui} 4 | \alias{app_ui} 5 | \title{ui} 6 | \usage{ 7 | app_ui(request) 8 | } 9 | \arguments{ 10 | \item{request}{needed for bookmarking} 11 | } 12 | \description{ 13 | ui 14 | } 15 | -------------------------------------------------------------------------------- /shiny-examples-master/051-movie-explorer/global.R: -------------------------------------------------------------------------------- 1 | # Variables that can be put on the x and y axes 2 | axis_vars <- c( 3 | "Tomato Meter" = "Meter", 4 | "Numeric Rating" = "Rating", 5 | "Number of reviews" = "Reviews", 6 | "Dollars at box office" = "BoxOffice", 7 | "Year" = "Year", 8 | "Length (minutes)" = "Runtime" 9 | ) 10 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/R/run_app.R: -------------------------------------------------------------------------------- 1 | #' Run the Shiny Application 2 | #' 3 | #' @export 4 | #' @importFrom shiny shinyApp 5 | #' @importFrom golem with_golem_options 6 | run_app <- function(...) { 7 | with_golem_options( 8 | app = shinyApp(ui = app_ui, server = app_server), 9 | golem_opts = list(...) 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /shiny-examples-master/048-including-html-text-and-markdown-files/include.html: -------------------------------------------------------------------------------- 1 |

This file is include.html.

2 | 3 |

The content of this file is included as-is in the web page.

4 | 5 |
6 | This is a div with a light red background. 7 |
8 | -------------------------------------------------------------------------------- /shiny-examples-master/052-navbar-example/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | output$plot <- renderPlot({ 3 | plot(cars, type=input$plotType) 4 | }) 5 | 6 | output$summary <- renderPrint({ 7 | summary(cars) 8 | }) 9 | 10 | output$table <- DT::renderDataTable({ 11 | DT::datatable(cars) 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /shiny-examples-master/077-widget-slider/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # You can access the value of the widget with input$slider1, e.g. 4 | output$value <- renderPrint({ input$slider1 }) 5 | 6 | # You can access the values of the second widget with input$slider2, e.g. 7 | output$range <- renderPrint({ input$slider2 }) 8 | } 9 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/R/app_server.R: -------------------------------------------------------------------------------- 1 | #' @import shiny 2 | app_server <- function(input, output,session) { 3 | # List the first level callModules here 4 | set.seed(122) 5 | histdata <- rnorm(500) 6 | 7 | output$plot1 <- renderPlot({ 8 | data <- histdata[seq_len(input$slider)] 9 | hist(data) 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /shiny-examples-master/017-select-vs-selectize/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | output$out1 <- renderPrint(input$in1) 3 | output$out2 <- renderPrint(input$in2) 4 | output$out3 <- renderPrint(input$in3) 5 | output$out4 <- renderPrint(input$in4) 6 | output$out5 <- renderPrint(input$in5) 7 | output$out6 <- renderPrint(input$in6) 8 | } 9 | -------------------------------------------------------------------------------- /shiny-examples-master/060-retirement-simulation/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Retirement simulation 2 | License: MIT 3 | Author: Michael Kapler , Joe Cheng 4 | AuthorUrl: http://systematicinvestor.wordpress.com/ 5 | Tags: simluation finance application-layout bootstrap-theme 6 | DisplayMode: Normal 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /shiny-examples-master/088-action-pattern1/www/message-handler.js: -------------------------------------------------------------------------------- 1 | // This recieves messages of type "testmessage" from the server. 2 | // See http://shiny.rstudio.com/gallery/server-to-client-custom-messages.html 3 | // for details 4 | Shiny.addCustomMessageHandler("testmessage", 5 | function(message) { 6 | alert(JSON.stringify(message)); 7 | } 8 | ); -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/data-raw/DATASET.R: -------------------------------------------------------------------------------- 1 | ## code to prepare `DATASET` dataset goes here 2 | paramNames <- c("start_capital", "annual_mean_return", "annual_ret_std_dev", 3 | "annual_inflation", "annual_inf_std_dev", "monthly_withdrawals", "n_obs", 4 | "n_sim") 5 | usethis::use_data(paramNames) 6 | -------------------------------------------------------------------------------- /shiny-examples-master/076-widget-select/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a select box 4 | selectInput("select", label = h3("Select box"), 5 | choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 6 | selected = 1), 7 | 8 | hr(), 9 | fluidRow(column(3, verbatimTextOutput("value"))) 10 | 11 | ) 12 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-original/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Title: Retirement simulation 2 | License: MIT 3 | Author: Michael Kapler , Joe Cheng 4 | AuthorUrl: http://systematicinvestor.wordpress.com/ 5 | Tags: simluation finance application-layout bootstrap-theme 6 | DisplayMode: Normal 7 | Type: Shiny 8 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/R/run_app.R: -------------------------------------------------------------------------------- 1 | #' Run the Shiny Application 2 | #' 3 | #' @export 4 | #' @importFrom shiny shinyApp 5 | #' @importFrom golem with_golem_options 6 | run_app <- function(...) { 7 | with_golem_options( 8 | app = shinyApp(ui = app_ui, server = app_server), 9 | golem_opts = list(...) 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /shiny-examples-master/075-widget-radio/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the line below to make a set of radio buttons 4 | radioButtons("radio", label = h3("Radio buttons"), 5 | choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 6 | selected = 1), 7 | 8 | hr(), 9 | fluidRow(column(3, verbatimTextOutput("value"))) 10 | 11 | ) 12 | -------------------------------------------------------------------------------- /shiny-examples-master/112-generate-report/README.md: -------------------------------------------------------------------------------- 1 | This app generates a downloadable report when the download button is clicked. It uses a .Rmd file to generate the report. [Source code](https://github.com/rstudio/shiny-examples/tree/master/112-generate-report). Note that this app uses a temporaray directory because the app directory might not be writable when deployed. 2 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/man/run_app.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_app.R 3 | \name{run_app} 4 | \alias{run_app} 5 | \title{Run the Shiny Application} 6 | \usage{ 7 | run_app(...) 8 | } 9 | \arguments{ 10 | \item{...}{Add options to your app} 11 | } 12 | \description{ 13 | Run the Shiny Application 14 | } 15 | -------------------------------------------------------------------------------- /shiny-examples-master/shiny-examples.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | -------------------------------------------------------------------------------- /shiny-examples-master/086-bus-dashboard/metrotransit-data/metrotransit-data.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | -------------------------------------------------------------------------------- /shiny-dashboard/readme.md: -------------------------------------------------------------------------------- 1 | ## Shiny dashboard to golem 2 | 3 | Example from https://rstudio.github.io/shinydashboard/get_started.html 4 | 5 | ## UI 6 | 7 | Copied the `dashboardPage` code inside app_ui, replacing the fluidPage code. 8 | 9 | ## Server 10 | 11 | Copied the server code to app_server 12 | 13 | ## Deps 14 | 15 | Added shiny & shinydashboard to the dependencies. -------------------------------------------------------------------------------- /shiny-examples-master/023-optgroup-server/Readme.md: -------------------------------------------------------------------------------- 1 | We can use `updateSelectizeInput(server = TRUE)` to make use of the server-side selectize input, but it is not straightforward to obtain the `` info from the server side dynamically. In this case, we just predefine the option groups in the initialization configurations. 2 | 3 | Note this feature requires **shiny** >= 0.10.1. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/049-isolate-demo/README.md: -------------------------------------------------------------------------------- 1 | In this example, changing `n` will not result in an update to the summary text, because it is always used within `isolate()` on the server side. 2 | 3 | However, changing `text` or clicking on the button will result in the summary text updating, because when `input$text` and `input$goButton` are accessed it is **not** inside `isolate()`. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/110-error-sanitization/README.md: -------------------------------------------------------------------------------- 1 | If you are worried about sensitive information leaking through to the users of your app via error messages, fret not! You now have the option of sanitizing error messages, meaning that users will only see a generic error message unless you specify otherwise. Explore the app tabs to learn more about the error hiding mechanism in Shiny. -------------------------------------------------------------------------------- /001-hello/001-hello-golem/R/run_app.R: -------------------------------------------------------------------------------- 1 | #' Run the Shiny Application 2 | #' 3 | #' @param ... Add options to your app 4 | #' 5 | #' @export 6 | #' @importFrom shiny shinyApp 7 | #' @importFrom golem with_golem_options 8 | run_app <- function(...) { 9 | with_golem_options( 10 | app = shinyApp(ui = app_ui, server = app_server), 11 | golem_opts = list(...) 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /shiny-examples-master/015-layout-sidebar/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | titlePanel("Hello Shiny!"), 4 | 5 | # put the side bar on the right 6 | sidebarLayout(position = "right", 7 | 8 | sidebarPanel( 9 | sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30) 10 | ), 11 | 12 | mainPanel( 13 | plotOutput("distPlot") 14 | ) 15 | ) 16 | ) 17 | -------------------------------------------------------------------------------- /shiny-examples-master/032-client-data-and-query-string/ui.r: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel("Client data and query string example"), 3 | 4 | fluidRow( 5 | column(8, 6 | h3("session$clientdata values"), 7 | verbatimTextOutput("summary"), 8 | h3("Parsed URL query string"), 9 | verbatimTextOutput("queryText", placeholder = TRUE) 10 | ) 11 | ) 12 | ) 13 | -------------------------------------------------------------------------------- /shiny-examples-master/151-reactr-input/js/input.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | function SimpleTextInput(props) { 3 | return React.createElement('input', { 4 | value: props.value, 5 | onChange: function(e) { 6 | props.setValue(e.target.value); 7 | } 8 | }); 9 | } 10 | reactR.reactShinyInput('.simple-text-input', 'shiny.examples', SimpleTextInput); 11 | })(); 12 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/man/run_app.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_app.R 3 | \name{run_app} 4 | \alias{run_app} 5 | \title{Run the Shiny Application} 6 | \usage{ 7 | run_app(...) 8 | } 9 | \arguments{ 10 | \item{...}{A list of Options to be added to the app} 11 | } 12 | \description{ 13 | Run the Shiny Application 14 | } 15 | -------------------------------------------------------------------------------- /shiny-examples-master/061-server-to-client-custom-messages/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | # An observer is used to send messages to the client. 3 | # The message is converted to JSON 4 | observe({ 5 | session$sendCustomMessage(type = 'testmessage', 6 | message = list(a = 1, b = 'text', 7 | controller = input$controller)) 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /shiny-examples-master/069-widget-check-group/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | # Copy the chunk below to make a group of checkboxes 4 | checkboxGroupInput("checkGroup", label = h3("Checkbox group"), 5 | choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3), 6 | selected = 1), 7 | 8 | 9 | hr(), 10 | fluidRow(column(3, verbatimTextOutput("value"))) 11 | 12 | ) 13 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: hellogolem 2 | Title: golem Hello Shiny 3 | Version: 0.0.0.9000 4 | Authors@R: person('RStudio', 'Inc.', email = 'AUTHOR@MAIL.COM', role = c('cre', 'aut')) 5 | Description: Turning Hello Shiny into Golem app. 6 | License: MIT + file LICENSE 7 | Encoding: UTF-8 8 | LazyData: true 9 | Imports: 10 | shiny, 11 | golem 12 | RoxygenNote: 6.1.1 13 | -------------------------------------------------------------------------------- /shiny-examples-master/015-layout-sidebar/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | output$distPlot <- renderPlot({ 4 | x <- faithful[, 2] # Old Faithful Geyser data 5 | bins <- seq(min(x), max(x), length.out = input$bins + 1) 6 | 7 | # draw the histogram with the specified number of bins 8 | hist(x, breaks = bins, col = 'darkgray', border = 'white') 9 | }) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /shiny-examples-master/028-actionbutton-demo/server.r: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | # builds a reactive expression that only invalidates 4 | # when the value of input$goButton becomes out of date 5 | # (i.e., when the button is pressed) 6 | ntext <- eventReactive(input$goButton, { 7 | input$n 8 | }) 9 | 10 | output$nText <- renderText({ 11 | ntext() 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /shiny-examples-master/048-including-html-text-and-markdown-files/include.txt: -------------------------------------------------------------------------------- 1 | This file is include.txt. 2 | 3 | The content of this file is escaped, so special characters like & and
will display correctly in the web page. However, no other processing is done, so hard breaks and multiple spaces will be rendered as usual in HTML. 4 | 5 | If you want to display preformatted text, wrap the text in pre(). 6 | -------------------------------------------------------------------------------- /shiny-examples-master/028-actionbutton-demo/ui.r: -------------------------------------------------------------------------------- 1 | pageWithSidebar( 2 | headerPanel("actionButton test"), 3 | sidebarPanel( 4 | numericInput("n", "N:", min = 0, max = 100, value = 50), 5 | br(), 6 | actionButton("goButton", "Go!"), 7 | p("Click the button to update the value displayed in the main panel.") 8 | ), 9 | mainPanel( 10 | verbatimTextOutput("nText") 11 | ) 12 | ) 13 | -------------------------------------------------------------------------------- /shiny-examples-master/114-modal-dialog/app.R: -------------------------------------------------------------------------------- 1 | shinyApp( 2 | ui = basicPage( 3 | actionButton("show", "Show modal dialog") 4 | ), 5 | server = function(input, output) { 6 | observeEvent(input$show, { 7 | showModal(modalDialog( 8 | title = "Important message", 9 | "This is an important message!", 10 | easyClose = TRUE 11 | )) 12 | }) 13 | } 14 | ) 15 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/R/run_app.R: -------------------------------------------------------------------------------- 1 | #' Run the Shiny Application 2 | #' 3 | #' @param ... A list of Options to be added to the app 4 | #' 5 | #' @export 6 | #' @importFrom shiny shinyApp 7 | #' @importFrom golem with_golem_options 8 | run_app <- function(...) { 9 | with_golem_options( 10 | app = shinyApp(ui = app_ui, server = app_server), 11 | golem_opts = list(...) 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /shiny-examples-master/027-absolutely-positioned-panels/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | output$plot <- renderPlot({ 3 | mtscaled <- as.matrix(scale(mtcars)) 4 | heatmap(mtscaled, 5 | col = topo.colors(200, alpha=0.5), 6 | Colv=F, scale="none") 7 | }) 8 | 9 | output$plot2 <- renderPlot({ 10 | plot(head(cars, input$n), main="Foo") 11 | }, bg = "#F5F5F5") 12 | } 13 | -------------------------------------------------------------------------------- /shiny-examples-master/053-navlistpanel-example/ui.r: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | titlePanel("Navlist panel example"), 4 | 5 | navlistPanel( 6 | "Header", 7 | tabPanel("First", 8 | h3("This is the first panel") 9 | ), 10 | tabPanel("Second", 11 | h3("This is the second panel") 12 | ), 13 | tabPanel("Third", 14 | h3("This is the third panel") 15 | ) 16 | ) 17 | ) 18 | -------------------------------------------------------------------------------- /shiny-examples-master/141-radiant/app.R: -------------------------------------------------------------------------------- 1 | ## CRAN 2 | # install.packages("radiant") 3 | 4 | ## Github instructions 5 | # install.packages("radiant", repos = "https://radiant-rstats.github.io/minicran/") 6 | 7 | library(radiant) 8 | 9 | ## Regular execution 10 | # radiant::radiant() 11 | 12 | # Retrieve the underlying shinyapp in radiant 13 | shiny::shinyAppDir(system.file("app", package = "radiant")) 14 | -------------------------------------------------------------------------------- /002-text/002-text-golem/dev/run_dev.R: -------------------------------------------------------------------------------- 1 | # Set options here 2 | options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode 3 | 4 | # Detach all loaded packages and clean your environment 5 | golem::detach_all_attached() 6 | # rm(list=ls(all.names = TRUE)) 7 | 8 | # Document and reload your package 9 | golem::document_and_reload() 10 | 11 | # Run the application 12 | shinytext::run_app() 13 | -------------------------------------------------------------------------------- /shiny-examples-master/035-custom-input-bindings/ui.R: -------------------------------------------------------------------------------- 1 | source("url-input.R") 2 | 3 | fluidPage( 4 | titlePanel("Custom input example"), 5 | 6 | fluidRow( 7 | column(4, wellPanel( 8 | urlInput("my_url", "URL: ", "http://www.r-project.org/"), 9 | actionButton("reset", "Reset URL") 10 | )), 11 | column(8, wellPanel( 12 | verbatimTextOutput("urlText") 13 | )) 14 | ) 15 | ) 16 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/dev/run_dev.R: -------------------------------------------------------------------------------- 1 | # Set options here 2 | options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode 3 | 4 | # Detach all loaded packages and clean your environment 5 | golem::detach_all_attached() 6 | # rm(list=ls(all.names = TRUE)) 7 | 8 | # Document and reload your package 9 | golem::document_and_reload() 10 | 11 | # Run the application 12 | hellogolem::run_app() 13 | -------------------------------------------------------------------------------- /002-text/002-text-golem/002-text-golem.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | -------------------------------------------------------------------------------- /shiny-examples-master/.gitignore: -------------------------------------------------------------------------------- 1 | # History files 2 | .Rhistory 3 | .RData 4 | 5 | # Example code in package build process 6 | *-Ex.R 7 | .Rproj.user 8 | 9 | # ShinyApps manifest 10 | *.dcf 11 | 12 | # Fonts 13 | *.ttc 14 | 15 | # DS Store 16 | .DS_Store 17 | 18 | 19 | # Log Files 20 | logfile*.txt 21 | 22 | # Packrat lockfiles generated during RSC deploy 23 | packrat.lock 24 | 25 | 169-prerender-a/index.html 26 | -------------------------------------------------------------------------------- /shiny-examples-master/020-knit-html/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | title = 'Embed an HTML report from R Markdown/knitr', 3 | sidebarLayout( 4 | sidebarPanel( 5 | withMathJax(), # include the MathJax library 6 | selectInput('x', 'Build a regression model of mpg against:', 7 | choices = names(mtcars)[-1]) 8 | ), 9 | mainPanel( 10 | uiOutput('report') 11 | ) 12 | ) 13 | ) 14 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/001-hello-golem.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | -------------------------------------------------------------------------------- /shiny-examples-master/012-datatables/Readme.md: -------------------------------------------------------------------------------- 1 | We have three tables in this example: 2 | 3 | - For the `diamonds` data, we can select variables to show in the table. 4 | 5 | - For the `mtcars` example, we use `orderClasses = TRUE` so that sorted 6 | columns are colored since they have special CSS classes attached. 7 | 8 | - For the `iris` data, we customize the length menu so we can display 5 rows 9 | per page. 10 | -------------------------------------------------------------------------------- /shiny-examples-master/018-datatable-options/ui.R: -------------------------------------------------------------------------------- 1 | navbarPage( 2 | title = 'DataTable Options', 3 | tabPanel('Display length', DT::dataTableOutput('ex1')), 4 | tabPanel('Length menu', DT::dataTableOutput('ex2')), 5 | tabPanel('No pagination', DT::dataTableOutput('ex3')), 6 | tabPanel('No filtering', DT::dataTableOutput('ex4')), 7 | tabPanel('Function callback', DT::dataTableOutput('ex5')) 8 | ) 9 | -------------------------------------------------------------------------------- /shiny-examples-master/088-action-pattern1/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- fluidPage( 4 | tags$head(tags$script(src = "message-handler.js")), 5 | actionButton("do", "Click Me") 6 | ) 7 | 8 | server <- function(input, output, session) { 9 | observeEvent(input$do, { 10 | session$sendCustomMessage(type = 'testmessage', 11 | message = 'Thank you for clicking') 12 | }) 13 | } 14 | 15 | shinyApp(ui, server) -------------------------------------------------------------------------------- /002-text/002-text-golem/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: shinytext 2 | Title: Shiny Text 3 | Version: 0.0.0.9000 4 | Authors@R: person('RStudio', 'Inc', email = 'AUTHOR@MAIL.COM', role = c('cre', 'aut')) 5 | Description: Shiny Text as a golem app. 6 | License: MIT + file LICENSE 7 | Encoding: UTF-8 8 | LazyData: true 9 | Imports: 10 | shiny, 11 | golem, 12 | processx 13 | RoxygenNote: 6.1.1 14 | Suggests: 15 | testthat 16 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/dev/run_dev.R: -------------------------------------------------------------------------------- 1 | # Set options here 2 | options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode 3 | 4 | # Detach all loaded packages and clean your environment 5 | golem::detach_all_attached() 6 | # rm(list=ls(all.names = TRUE)) 7 | 8 | # Document and reload your package 9 | golem::document_and_reload() 10 | 11 | # Run the application 12 | reactivity::run_app() 13 | -------------------------------------------------------------------------------- /shiny-examples-master/013-selectize/server.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | function(input, output) { 4 | output$ex_out <- renderPrint({ 5 | str(sapply(sprintf('e%d', 0:7), function(id) { 6 | input[[id]] 7 | }, simplify = FALSE)) 8 | }) 9 | output$github <- renderText({ 10 | paste('You selected', if (input$github == '') 'nothing' else input$github, 11 | 'in the Github example.') 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /shiny-examples-master/035-custom-input-bindings/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | output$urlText <- renderText({ 4 | as.character(input$my_url) 5 | }) 6 | 7 | observe({ 8 | # Run whenever reset button is pressed 9 | input$reset 10 | 11 | # Send an update to my_url, resetting its value 12 | updateUrlInput(session, "my_url", value = "http://www.r-project.org/") 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/dev/run_dev.R: -------------------------------------------------------------------------------- 1 | # Set options here 2 | options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode 3 | 4 | # Detach all loaded packages and clean your environment 5 | golem::detach_all_attached() 6 | # rm(list=ls(all.names = TRUE)) 7 | 8 | # Document and reload your package 9 | golem::document_and_reload() 10 | 11 | # Run the application 12 | golemdashboard::run_app() 13 | -------------------------------------------------------------------------------- /shiny-examples-master/130-output-null/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- fluidPage( 4 | h3("Pressing \"Clear\" should clear the plot."), 5 | plotOutput("plot"), 6 | actionButton("clear", "Clear") 7 | ) 8 | 9 | server <- function(input, output, session) { 10 | output$plot <- renderPlot({ plot(cars) }) 11 | 12 | observeEvent(input$clear, { 13 | output$plot <- NULL 14 | }) 15 | } 16 | 17 | shinyApp(ui, server) 18 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/003-reactivity-golem.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | -------------------------------------------------------------------------------- /shiny-examples-master/048-including-html-text-and-markdown-files/README.md: -------------------------------------------------------------------------------- 1 | It's possible to include files with HTML, text, or Markdown content in a Shiny app. 2 | 3 | HTML files will be included as-is, text files will have characters escaped, and Markdown files will be processed into HTML with the markdown package before inclusion. 4 | 5 | Be sure to look at the full source code for this app, since it has files other than ui.R and server.R. 6 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | output$mychart <- renderLineChart({ 4 | # Return a data frame. Each column will be a series in the line chart. 5 | data.frame( 6 | Sine = sin(1:100/10 + input$sinePhase * pi/180) * input$sineAmplitude, 7 | Cosine = 0.5 * cos(1:100/10), 8 | "Sine 2" = sin(1:100/10) * 0.25 + 0.5 9 | ) 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /shiny-examples-master/089-action-pattern2/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- fluidPage( 4 | actionButton("go", "Go"), 5 | numericInput("n", "n", 50), 6 | plotOutput("plot") 7 | ) 8 | 9 | server <- function(input, output) { 10 | 11 | randomVals <- eventReactive(input$go, { 12 | runif(input$n) 13 | }) 14 | 15 | output$plot <- renderPlot({ 16 | hist(randomVals()) 17 | }) 18 | } 19 | 20 | shinyApp(ui, server) 21 | -------------------------------------------------------------------------------- /shiny-examples-master/165-trailing-comma/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- fluidPage( 4 | 5 | titlePanel("Hello Shiny!"), 6 | 7 | # NOTE THE TRAILING COMMA 8 | textOutput(outputId = "text"), 9 | ) 10 | 11 | server <- function(input, output) { 12 | 13 | output$text <- renderText({ 14 | "If you're seeing this, things are fine." 15 | }) 16 | } 17 | 18 | # Create Shiny app ---- 19 | shinyApp(ui = ui, server = server) 20 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/shiny-dashboard-golem.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nvd3", 3 | "version": "0.0.1", 4 | "devDependencies": { 5 | "grunt": "~0.4.1", 6 | "grunt-contrib-jshint": "~0.3.0", 7 | "grunt-contrib-watch": "~0.3.1", 8 | "grunt-contrib-uglify": "~0.2.0", 9 | "grunt-contrib-concat": "~0.2.0", 10 | "grunt-contrib-copy": "~0.4.1", 11 | "grunt-contrib-cssmin": "~0.6.2" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: reactivity 2 | Title: Shiny reactivity 3 | Version: 0.0.0.9000 4 | Authors@R: person('RStudio', 'Inc', email = 'AUTHOR@MAIL.COM', role = c('cre', 'aut')) 5 | Description: Shiny reactivity as a golem app. 6 | License: MIT + file LICENSE 7 | Encoding: UTF-8 8 | LazyData: true 9 | Imports: 10 | shiny, 11 | golem, 12 | processx 13 | RoxygenNote: 6.1.1 14 | Suggests: 15 | testthat 16 | -------------------------------------------------------------------------------- /shiny-examples-master/169-prerender-b/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- fluidPage( 4 | "Below is a test for behavior described ", 5 | a("here", href = "https://github.com/rstudio/rmarkdown/pull/1631"), 6 | br(), 7 | span( 8 | id = "test-message", 9 | style = "color: red", 10 | "Test failed :(" 11 | ), 12 | tags$script(src = "js/run-test.js") 13 | ) 14 | 15 | server <- function(input, output) {} 16 | 17 | shinyApp(ui, server) 18 | -------------------------------------------------------------------------------- /shiny-examples-master/176-jquery-3/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | options(shiny.jquery.version = NULL) 4 | 5 | ui <- fluidPage( 6 | p("This test verifies the default jQuery version."), 7 | p("The number below is the jQuery version number. It should begin with a 3."), 8 | tags$script(HTML(" 9 | document.write(jQuery.fn.jquery); 10 | ")) 11 | ) 12 | 13 | server <- function(input, output, session) { 14 | 15 | } 16 | 17 | shinyApp(ui, server) 18 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/dev/run_dev.R: -------------------------------------------------------------------------------- 1 | # Set options here 2 | options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode 3 | 4 | # Detach all loaded packages and clean your environment 5 | golem::detach_all_attached() 6 | # rm(list=ls(all.names = TRUE)) 7 | 8 | # Document and reload your package 9 | golem::document_and_reload() 10 | 11 | # Run the application 12 | retirementsimulationgolem::run_app() 13 | -------------------------------------------------------------------------------- /shiny-examples-master/034-current-time/server.R: -------------------------------------------------------------------------------- 1 | options(digits.secs = 3) # Include milliseconds in time display 2 | 3 | function(input, output, session) { 4 | 5 | output$currentTime <- renderText({ 6 | # invalidateLater causes this output to automatically 7 | # become invalidated when input$interval milliseconds 8 | # have elapsed 9 | invalidateLater(as.integer(input$interval), session) 10 | 11 | format(Sys.time()) 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /shiny-examples-master/034-current-time/ui.R: -------------------------------------------------------------------------------- 1 | basicPage( 2 | h4( 3 | "The time is ", 4 | # We give textOutput a span container to make it appear 5 | # right in the h4, without starting a new line. 6 | textOutput("currentTime", container = span) 7 | ), 8 | selectInput("interval", "Update every:", c( 9 | "5 seconds" = "5000", 10 | "1 second" = "1000", 11 | "0.5 second" = "500" 12 | ), selected = 1000, selectize = FALSE) 13 | ) 14 | -------------------------------------------------------------------------------- /shiny-examples-master/084-single-file/app.R: -------------------------------------------------------------------------------- 1 | # Global variables can go here 2 | n <- 200 3 | 4 | 5 | # Define the UI 6 | ui <- bootstrapPage( 7 | numericInput('n', 'Number of obs', n), 8 | plotOutput('plot') 9 | ) 10 | 11 | 12 | # Define the server code 13 | server <- function(input, output) { 14 | output$plot <- renderPlot({ 15 | hist(runif(input$n)) 16 | }) 17 | } 18 | 19 | # Return a Shiny app object 20 | shinyApp(ui = ui, server = server) 21 | -------------------------------------------------------------------------------- /shiny-examples-master/024-optgroup-selectize/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | updateSelectizeInput(session, 'x2', choices = list( 4 | Eastern = c(`Rhode Island` = 'RI', `New Jersey` = 'NJ'), 5 | Western = c(`Oregon` = 'OR', `Washington` = 'WA'), 6 | Middle = list(Iowa = 'IA') 7 | ), selected = 'IA') 8 | 9 | output$values <- renderPrint({ 10 | list(x1 = input$x1, x2 = input$x2, x3 = input$x3, x4 = input$x4) 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/060-retirement-simulation-golem.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | -------------------------------------------------------------------------------- /shiny-examples-master/096-plot-interaction-article-1/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- basicPage( 4 | plotOutput("plot1", click = "plot_click"), 5 | verbatimTextOutput("info") 6 | ) 7 | 8 | server <- function(input, output) { 9 | output$plot1 <- renderPlot({ 10 | plot(mtcars$wt, mtcars$mpg) 11 | }) 12 | 13 | output$info <- renderText({ 14 | paste0("x=", input$plot_click$x, "\ny=", input$plot_click$y) 15 | }) 16 | } 17 | 18 | shinyApp(ui, server) 19 | -------------------------------------------------------------------------------- /shiny-examples-master/113-bookmarking-url/app.R: -------------------------------------------------------------------------------- 1 | ui <- function(request) { 2 | fluidPage( 3 | plotOutput("plot"), 4 | sliderInput("n", "Number of observations", 1, nrow(faithful), 100), 5 | bookmarkButton() 6 | ) 7 | } 8 | 9 | server <- function(input, output, session) { 10 | output$plot <- renderPlot({ 11 | hist(faithful$eruptions[seq_len(input$n)], breaks = 40) 12 | }) 13 | } 14 | 15 | enableBookmarking(store = "url") 16 | shinyApp(ui, server) 17 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: retirementsimulationgolem 2 | Title: Retirement simulation 3 | Version: 0.0.0.9000 4 | Author: Michael Kapler , Joe Cheng 5 | AuthorUrl: http://systematicinvestor.wordpress.com/ 6 | Description: Made this example a golem. 7 | License: MIT 8 | Encoding: UTF-8 9 | LazyData: true 10 | Imports: 11 | shiny, 12 | golem 13 | RoxygenNote: 6.1.1 14 | -------------------------------------------------------------------------------- /shiny-examples-master/021-selectize-plot/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | title = 'Create plots in selectize input', 3 | fluidRow( 4 | column( 5 | 5, 6 | plotOutput('parcoord'), 7 | hr(), 8 | selectizeInput('state', label = NULL, choices = NULL, options = list( 9 | placeholder = 'Type a state name, e.g. Iowa', maxOptions = 5) 10 | ) 11 | ), 12 | column( 13 | 7, 14 | DT::dataTableOutput('rawdata') 15 | ) 16 | ) 17 | ) 18 | -------------------------------------------------------------------------------- /shiny-examples-master/047-image-output/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel("Image output"), 3 | 4 | fluidRow( 5 | column(4, wellPanel( 6 | sliderInput("r", "Radius :", min = 0.05, max = 1, 7 | value = 0.2, step = 0.05), 8 | radioButtons("picture", "Picture:", 9 | c("chainring", "face")) 10 | )), 11 | column(4, 12 | imageOutput("image1", height = 300), 13 | imageOutput("image2") 14 | ) 15 | ) 16 | ) 17 | -------------------------------------------------------------------------------- /shiny-examples-master/148-addresourcepath-deleted/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | tempdir <- tempfile("test") 4 | dir.create(tempdir) 5 | addResourcePath("my_test_prefix", tempdir) 6 | unlink(tempdir, recursive = TRUE) 7 | 8 | ui <- HTML("This app tests whether deleting a directory pointed to by addResourcePath breaks Shiny. If you're reading this, the test passed!") 9 | 10 | server <- function(input, output, session) { 11 | } 12 | 13 | shinyApp(ui, server) 14 | 15 | -------------------------------------------------------------------------------- /shiny-examples-master/168-supporting-r-dir/R/counter.R: -------------------------------------------------------------------------------- 1 | counterButton <- function(id, label = "Counter") { 2 | ns <- NS(id) 3 | tagList( 4 | actionButton(ns("button"), label = label), 5 | verbatimTextOutput(ns("out")) 6 | ) 7 | } 8 | 9 | counter <- function(input, output, session) { 10 | count <- reactiveVal(0) 11 | observeEvent(input$button, { 12 | count(count() + 1) 13 | }) 14 | output$out <- renderText({ 15 | count() 16 | }) 17 | count 18 | } 19 | -------------------------------------------------------------------------------- /shiny-examples-master/170-date-range-max/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | ui <- fluidPage( 3 | dateInput("val", "Date Input", max = Sys.Date()), 4 | "Below is a test for ", 5 | a("#2355", href = "https://github.com/rstudio/shiny/issues/2335"), 6 | verbatimTextOutput("res") 7 | ) 8 | server <- function(input, output, session) { 9 | output$res <- renderPrint({ 10 | if (length(input$val) > 0) "Test passed!" else "Test didn't pass :(" 11 | }) 12 | } 13 | shinyApp(ui, server) 14 | -------------------------------------------------------------------------------- /shiny-examples-master/024-optgroup-selectize/Readme.md: -------------------------------------------------------------------------------- 1 | Sometimes it is more convenient to group all options into a few categories for the select/selectize input. To enable option groups, just use a nested list as the value of the `choices` argument of `selectInput()` / `selectizeInput()`. At least one of the child elements of the list must be of length >= 2, in other words, at least one option group should contain more than one option. 2 | 3 | Note this feature requires **shiny** >= 0.10.1. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/025-loop-ui/Readme.md: -------------------------------------------------------------------------------- 1 | When you want to create some UI elements from a loop, it is tempting to use the dark power `eval(parse())`, e.g. `for (i in 1:10)` `eval(parse(text = paste0("uiOutput('id", i, "'"))))`, but this is almost always the wrong way to go in shiny. It makes the code obscure and insecure. This example shows you how to express the logic more naturally and securely without manually constructing the program code and evaluating it using the `eval(parse())` trick. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/048-including-html-text-and-markdown-files/ui.r: -------------------------------------------------------------------------------- 1 | library(markdown) 2 | 3 | fluidPage( 4 | 5 | titlePanel("includeText, includeHTML, and includeMarkdown"), 6 | 7 | fluidRow( 8 | column(4, 9 | includeText("include.txt"), 10 | br(), 11 | pre(includeText("include.txt")) 12 | ), 13 | column(4, 14 | includeHTML("include.html") 15 | ), 16 | column(4, 17 | includeMarkdown("include.md") 18 | ) 19 | ) 20 | ) 21 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Jekyll Files # 3 | ################ 4 | _site 5 | 6 | 7 | # Random Files # 8 | ################ 9 | *.swp 10 | *~ 11 | *.log 12 | 13 | 14 | # Private Test Data # 15 | ##################### 16 | *REALDATA* 17 | 18 | 19 | # OS generated files # 20 | ###################### 21 | .DS_Store* 22 | ehthumbs.db 23 | Icon? 24 | Thumbs.db 25 | # nodejs packages # 26 | ###################### 27 | node_modules 28 | -------------------------------------------------------------------------------- /shiny-examples-master/062-submitbutton-demo/ui.r: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel("submitButton example"), 3 | fluidRow( 4 | column(3, wellPanel( 5 | sliderInput("n", "N:", min = 10, max = 1000, value = 200, 6 | step = 10), 7 | textInput("text", "Text:", "text here"), 8 | submitButton("Submit") 9 | )), 10 | column(6, 11 | plotOutput("plot1", width = 400, height = 300), 12 | verbatimTextOutput("text") 13 | ) 14 | ) 15 | ) 16 | -------------------------------------------------------------------------------- /shiny-examples-master/146-ames-explorer/helpers/data_functions.R: -------------------------------------------------------------------------------- 1 | highlight_prep <- function(data, highlight_rows) { 2 | # assumes data set has a "selected_" column 3 | res_filtered <- data %>% 4 | filter(selected_) %>% 5 | mutate(label_ind = row_number() %in% highlight_rows) 6 | 7 | res_unfiltered <- data %>% 8 | filter(!selected_) %>% 9 | mutate(label_ind = FALSE) 10 | 11 | res <- bind_rows(res_filtered, res_unfiltered) 12 | 13 | return(res) 14 | } 15 | -------------------------------------------------------------------------------- /shiny-examples-master/020-knit-html/Readme.md: -------------------------------------------------------------------------------- 1 | This example shows you how to knit an R Markdown document using the two packages **knitr** and **markdown**, and include the HTML output in a shiny app. Note we are using [R Markdown v1](http://rmarkdown.rstudio.com/authoring_migrating_from_v1.html) here, which has a couple of differences with [v2](http://rmarkdown.rstudio.com). The basic idea is to call `knitr::knit2html()` with the argument `fragment.only = TRUE` to generate a fragment of HTML code. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/039-download-file/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel('File download'), 3 | sidebarLayout( 4 | sidebarPanel( 5 | selectInput("dataset", "Choose a dataset:", 6 | choices = c("Rock", "Pressure", "Cars")), 7 | radioButtons("filetype", "File type:", 8 | choices = c("csv", "tsv")), 9 | downloadButton('downloadData', 'Download') 10 | ), 11 | mainPanel( 12 | tableOutput('table') 13 | ) 14 | ) 15 | ) 16 | -------------------------------------------------------------------------------- /shiny-examples-master/041-dynamic-ui/README.md: -------------------------------------------------------------------------------- 1 | The user interface components in this example are generated as HTML on the server inside a `renderUI()` block and sent to the client, which displays them with `uiOutput()`. Each time a new component is sent to the client, it completely replaces the previous component. This is different from the udpate input demo app, where the value of an existing input component is changed with a command from the server, but the component itself is not replaced with a new one. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/168-supporting-r-dir/Readme.md: -------------------------------------------------------------------------------- 1 | Demonstrates that `.R` files in the `R/` directory are automatically loaded at runtime. 2 | 3 | At the moment, this functionality is opt-in so this app requires setting the following option in order to work: 4 | 5 | ``` 6 | options(shiny.autoload.r = TRUE) 7 | ``` 8 | 9 | Without setting that option, the example will fail. 10 | 11 | Requires Shiny with the change in https://github.com/rstudio/shiny/pull/2547. This requires Shiny v1.3.2.9001. 12 | -------------------------------------------------------------------------------- /shiny-examples-master/063-superzip-example/gomap.js: -------------------------------------------------------------------------------- 1 | // When locator icon in datatable is clicked, go to that spot on the map 2 | $(document).on("click", ".go-map", function(e) { 3 | e.preventDefault(); 4 | $el = $(this); 5 | var lat = $el.data("lat"); 6 | var long = $el.data("long"); 7 | var zip = $el.data("zip"); 8 | $($("#nav a")[0]).tab("show"); 9 | Shiny.onInputChange("goto", { 10 | lat: lat, 11 | lng: long, 12 | zip: zip, 13 | nonce: Math.random() 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/R/app_server.R: -------------------------------------------------------------------------------- 1 | #' @import shiny 2 | app_server <- function(input, output,session) { 3 | # List the first level callModules here 4 | output$distPlot <- renderPlot({ 5 | 6 | x <- faithful$waiting 7 | bins <- seq(min(x), max(x), length.out = input$bins + 1) 8 | 9 | hist(x, breaks = bins, col = "#75AADB", border = "white", 10 | xlab = "Waiting time to next eruption (in mins)", 11 | main = "Histogram of waiting times") 12 | 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /shiny-examples-master/144-colors/countries.R: -------------------------------------------------------------------------------- 1 | # Converts countries.geojson to sf file and saves as RDS. This is 2 | # to spare people from needing to have rgdal installed just to 3 | # run the app. 4 | 5 | library(rgdal) 6 | library(sf) 7 | 8 | download.file("https://raw.githubusercontent.com/rstudio/leaflet/master/docs/json/countries.geojson", "countries.geojson") 9 | countries <- readOGR("countries.geojson", "OGRGeoJSON") 10 | saveRDS(st_as_sf(countries), "countries.rds") 11 | message("Saved countries.rds") 12 | -------------------------------------------------------------------------------- /shiny-examples-master/156-subapps/README.md: -------------------------------------------------------------------------------- 1 | Test for https://github.com/rstudio/shiny/issues/2385 2 | 3 | Run this test using `rmarkdown::run("index.Rmd")`. If you're running R from the terminal (not RStudio), you'll need to make sure that the `RSTUDIO_PANDOC` environment variable is defined, or that pandoc is on your system path. On Mac, it's like this: 4 | 5 | ``` 6 | RSTUDIO_PANDOC=/Applications/RStudio.app/Contents/MacOS/pandoc R --quiet -e 'rmarkdown::run("index.Rmd", shiny_args = list(launch.browser=TRUE))' 7 | ``` 8 | -------------------------------------------------------------------------------- /shiny-examples-master/019-mathjax/Readme.md: -------------------------------------------------------------------------------- 1 | The function `withMathJax()` is a wrapper function to load the 2 | [MathJax](http://www.mathjax.org) library in a shiny app. For static HTML 3 | content, we only need to call `withMathJax()` once. However, for dynamic UI 4 | output via `renderUI()`, we must wrap the content that contains math 5 | expressions in `withMathJax()`, because we have to call the MathJax function 6 | `MathJax.Hub.Queue(["Typeset", MathJax.Hub])` to render math manually, which is 7 | what `withMathJax()` does. 8 | -------------------------------------------------------------------------------- /shiny-examples-master/022-unicode-chinese/Readme.md: -------------------------------------------------------------------------------- 1 | 这个例子展示了Shiny应用中的中文字符。多字节字符在Windows上一直都是让人头疼的问题,因为Windows不像Linux或苹果系统那样统一使用UTF-8编码,而是有自己的成百上千种编码,不同的系统语言环境有不同的默认字符编码,每次涉及到多字节字符的读写问题的时候,开发者或用户都要问自己一个问题:我应该用什么编码?从shiny版本0.10.1开始,我们强制跟shiny应用有关的文件都使用UTF-8编码,包括ui.R / server.R / global.R / DESCRIPTION / README.md文件(不是所有文件都是shiny应用必需的)。如果你使用RStudio编辑器,你可以从菜单File -> Save with Encoding选择UTF-8编码保存你的shiny应用文件。 2 | 3 | If you do not understand Chinese, please take a look at [this article](http://shiny.rstudio.com/articles/unicode.html). 4 | -------------------------------------------------------------------------------- /shiny-examples-master/103-plot-interaction-article-8/app.R: -------------------------------------------------------------------------------- 1 | library(ggplot2) 2 | ui <- basicPage( 3 | plotOutput("plot1", 4 | brush = brushOpts(id = "plot_brush", fill = "#ccc", direction = "x"), 5 | height = 250 6 | ) 7 | ) 8 | 9 | server <- function(input, output) { 10 | output$plot1 <- renderPlot({ 11 | ggplot(ChickWeight, aes(x=Time, y=weight, colour=factor(Chick))) + 12 | geom_line() + 13 | guides(colour=FALSE) + 14 | theme_bw() 15 | }) 16 | } 17 | 18 | shinyApp(ui, server) 19 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: golemdashboard 2 | Title: An Amazing Shiny App 3 | Version: 0.0.0.9000 4 | Authors@R: 5 | person(given = "firstname", 6 | family = "lastname", 7 | role = c("aut", "cre"), 8 | email = "your@email.com") 9 | Description: What the package does (one paragraph). 10 | License: What license is it under? 11 | Imports: 12 | golem, 13 | shiny, 14 | shinydashboard 15 | Encoding: UTF-8 16 | LazyData: true 17 | RoxygenNote: 6.1.1 18 | -------------------------------------------------------------------------------- /shiny-examples-master/146-ames-explorer/README.md: -------------------------------------------------------------------------------- 1 | This is the Ames Housing Explorer Shiny application discussed in the 2019 `rstudio::conf` presentation entitled __Effective use of Shiny modules__ created by [Eric Nantz](https://github.com/rpodcast). You can view the application at [gallery.shinyapps.io/ames-explorer](https://gallery.shinyapps.io/ames-explorer/) This application requires the following packages (each available on CRAN): 2 | * shiny 3 | * dplyr 4 | * ggplot2 5 | * scales 6 | * gghighlight 7 | * DT 8 | * AmesHousing 9 | -------------------------------------------------------------------------------- /shiny-examples-master/011-timer/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | # Define UI for displaying current time ---- 4 | ui <- fluidPage( 5 | 6 | h2(textOutput("currentTime")) 7 | 8 | ) 9 | 10 | # Define server logic to show current time, update every second ---- 11 | server <- function(input, output, session) { 12 | 13 | output$currentTime <- renderText({ 14 | invalidateLater(1000, session) 15 | paste("The current time is", Sys.time()) 16 | }) 17 | 18 | } 19 | 20 | # Create Shiny app ---- 21 | shinyApp(ui, server) 22 | -------------------------------------------------------------------------------- /shiny-examples-master/016-knitr-pdf/report.Rmd: -------------------------------------------------------------------------------- 1 | Here is my regression model: 2 | 3 | ```{r model, collapse=TRUE} 4 | options(digits = 4) 5 | fit <- lm(regFormula(), data = mtcars) 6 | b <- coef(fit) 7 | summary(fit) 8 | ``` 9 | 10 | The fitting result is $mpg = `r b[1]` + `r b[2]``r input$x`$. 11 | Below is a scatter plot with the regression line. 12 | 13 | ```{r plot, fig.height=5} 14 | par(mar = c(4, 4, 1, 1)) 15 | plot(regFormula(), data = mtcars, pch = 19, col = 'gray') 16 | abline(fit, col = 'red', lwd = 2) 17 | ``` 18 | -------------------------------------------------------------------------------- /shiny-examples-master/016-knitr-pdf/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | title = 'Download a PDF report', 3 | sidebarLayout( 4 | sidebarPanel( 5 | helpText(), 6 | selectInput('x', 'Build a regression model of mpg against:', 7 | choices = names(mtcars)[-1]), 8 | radioButtons('format', 'Document format', c('PDF', 'HTML', 'Word'), 9 | inline = TRUE), 10 | downloadButton('downloadReport') 11 | ), 12 | mainPanel( 13 | plotOutput('regPlot') 14 | ) 15 | ) 16 | ) 17 | -------------------------------------------------------------------------------- /shiny-examples-master/020-knit-html/report.Rmd: -------------------------------------------------------------------------------- 1 | Here is my regression model: 2 | 3 | ```{r model, collapse=TRUE} 4 | options(digits = 4) 5 | fit <- lm(regFormula(), data = mtcars) 6 | b <- coef(fit) 7 | summary(fit) 8 | ``` 9 | 10 | The fitting result is $mpg = `r b[1]` + `r b[2]``r input$x`$. 11 | Below is a scatter plot with the regression line. 12 | 13 | ```{r plot, fig.height=5} 14 | par(mar = c(4, 4, 1, 1)) 15 | plot(regFormula(), data = mtcars, pch = 19, col = 'gray') 16 | abline(fit, col = 'red', lwd = 2) 17 | ``` 18 | -------------------------------------------------------------------------------- /shiny-examples-master/100-plot-interaction-article-5/app.R: -------------------------------------------------------------------------------- 1 | ui <- basicPage( 2 | plotOutput("plot1", brush = "plot_brush"), 3 | verbatimTextOutput("info") 4 | ) 5 | 6 | server <- function(input, output) { 7 | output$plot1 <- renderPlot({ 8 | plot(mtcars$wt, mtcars$mpg) 9 | }) 10 | 11 | output$info <- renderPrint({ 12 | # With base graphics, need to tell it what the x and y variables are. 13 | brushedPoints(mtcars, input$plot_brush, xvar = "wt", yvar = "mpg") 14 | }) 15 | } 16 | 17 | shinyApp(ui, server) 18 | -------------------------------------------------------------------------------- /shiny-examples-master/106-plot-interaction-exclude/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates how to exclude points from a computation. You can exclude points from a linear model by clicking on points, or by selecting them with a brush and clicking "Toggle points". 2 | 3 | To record the state of which rows of data are kept and which are excluded, we use a `reactiveValues` object containing a logical vector, each element of which represents whether each row is kept or excluded. The reactive value is modified whenever points are clicked or toggled. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/101-plot-interaction-article-6/app.R: -------------------------------------------------------------------------------- 1 | library(ggplot2) 2 | ui <- basicPage( 3 | plotOutput("plot1", brush = "plot_brush", height = 250), 4 | verbatimTextOutput("info") 5 | ) 6 | 7 | server <- function(input, output) { 8 | output$plot1 <- renderPlot({ 9 | ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() + 10 | facet_grid(. ~ cyl) + 11 | theme_bw() 12 | }) 13 | 14 | output$info <- renderPrint({ 15 | brushedPoints(mtcars, input$plot_brush) 16 | }) 17 | } 18 | 19 | shinyApp(ui, server) 20 | -------------------------------------------------------------------------------- /shiny-examples-master/080-widget-text/README.md: -------------------------------------------------------------------------------- 1 | 2 | textInput(inputId, label, value = "") 3 | 4 | 5 | Create a text field to enter text in. The widget will pass the text displayed to the server as a character string. 6 | 7 | ##### Arguments 8 | 9 | `inputId` 10 | The name to use to look up the value of the widget (as a character string) 11 | 12 | `label` 13 | A label to display above the text field 14 | 15 | `value` 16 | The initial text to display in the box, if any 17 | 18 | _Make this widget by copying the code in ui.R._ 19 | -------------------------------------------------------------------------------- /shiny-examples-master/115-bookmarking-updatequerystring/app.R: -------------------------------------------------------------------------------- 1 | ui <- function(req) { 2 | fluidPage( 3 | textInput("txt", "Text"), 4 | checkboxInput("chk", "Checkbox") 5 | ) 6 | } 7 | server <- function(input, output, session) { 8 | observe({ 9 | # Trigger this observer every time an input changes 10 | reactiveValuesToList(input) 11 | session$doBookmark() 12 | }) 13 | onBookmarked(function(url) { 14 | updateQueryString(url) 15 | }) 16 | } 17 | 18 | enableBookmarking(store = "url") 19 | shinyApp(ui, server) 20 | -------------------------------------------------------------------------------- /shiny-examples-master/102-plot-interaction-article-7/app.R: -------------------------------------------------------------------------------- 1 | library(ggplot2) 2 | ui <- basicPage( 3 | plotOutput("plot1", brush = "plot_brush"), 4 | verbatimTextOutput("info") 5 | ) 6 | 7 | server <- function(input, output) { 8 | options(width = 100) # Increase text width for printing table 9 | output$plot1 <- renderPlot({ 10 | ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() 11 | }) 12 | 13 | output$info <- renderPrint({ 14 | brushedPoints(mtcars, input$plot_brush, allRows = TRUE) 15 | }) 16 | } 17 | 18 | shinyApp(ui, server) 19 | -------------------------------------------------------------------------------- /shiny-examples-master/064-telephones-by-region/server.R: -------------------------------------------------------------------------------- 1 | # Rely on the 'WorldPhones' dataset in the datasets 2 | # package (which generally comes preloaded). 3 | library(datasets) 4 | 5 | # Define a server for the Shiny app 6 | function(input, output) { 7 | 8 | # Fill in the spot we created for a plot 9 | output$phonePlot <- renderPlot({ 10 | 11 | # Render a barplot 12 | barplot(WorldPhones[,input$region]*1000, 13 | main=input$region, 14 | ylab="Number of Telephones", 15 | xlab="Year") 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /shiny-examples-master/108-module-output/Readme.md: -------------------------------------------------------------------------------- 1 | This small example shows a Shiny module (`linked_scatter.R`) and how it can be 2 | used within an application (`app.R`). The linked scatter module lets the caller 3 | specify the data frame (mpg) and dimensions (cty/hwy and drv/hwy) that should 4 | be plotted, and also returns a reactive expression that contains the data 5 | frame with selection info in a `selected_` column. It renders two scatter 6 | plots that can be brushed (click and drag to make a selection) with coordinated 7 | highlighting between the plots. 8 | -------------------------------------------------------------------------------- /shiny-examples-master/156-subapps/app2/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Hello, world! 13 | 14 | 15 | -------------------------------------------------------------------------------- /shiny-examples-master/025-loop-ui/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | title = 'Creating a UI from a loop', 3 | 4 | sidebarLayout( 5 | sidebarPanel( 6 | # create some select inputs 7 | lapply(1:5, function(i) { 8 | selectInput(paste0('a', i), paste0('SelectA', i), 9 | choices = sample(LETTERS, 5)) 10 | }) 11 | ), 12 | 13 | mainPanel( 14 | verbatimTextOutput('a_out'), 15 | 16 | # UI output 17 | lapply(1:10, function(i) { 18 | uiOutput(paste0('b', i)) 19 | }) 20 | ) 21 | ) 22 | ) 23 | -------------------------------------------------------------------------------- /shiny-examples-master/049-isolate-demo/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel("isolate example"), 3 | fluidRow( 4 | column(4, wellPanel( 5 | sliderInput("n", "n (isolated):", 6 | min = 10, max = 1000, value = 200, step = 10), 7 | 8 | textInput("text", "text (not isolated):", "input text"), 9 | 10 | br(), 11 | actionButton("goButton", "Go!") 12 | )), 13 | column(8, 14 | h4("summary"), 15 | textOutput("summary"), 16 | h4("summary2"), 17 | textOutput("summary2") 18 | ) 19 | ) 20 | ) 21 | -------------------------------------------------------------------------------- /shiny-examples-master/050-kmeans-example/ui.R: -------------------------------------------------------------------------------- 1 | # k-means only works with numerical variables, 2 | # so don't give the user the option to select 3 | # a categorical variable 4 | vars <- setdiff(names(iris), "Species") 5 | 6 | pageWithSidebar( 7 | headerPanel('Iris k-means clustering'), 8 | sidebarPanel( 9 | selectInput('xcol', 'X Variable', vars), 10 | selectInput('ycol', 'Y Variable', vars, selected = vars[[2]]), 11 | numericInput('clusters', 'Cluster count', 3, min = 1, max = 9) 12 | ), 13 | mainPanel( 14 | plotOutput('plot1') 15 | ) 16 | ) 17 | -------------------------------------------------------------------------------- /shiny-examples-master/065-update-input-demo/README.md: -------------------------------------------------------------------------------- 1 | The user interface components in this example are updated when the server sends a command to the client. This is different from the Dynamic UI example, where the user interface component is generated on the server and sent to the client, where it replaces an existing UI component. Updating an input is faster and usually preferable, but sometimes it's not powerful enough - for example, if you want to replace the UI component with one of a different type, you need to replace it. See the Dynamic UI demo for an example of this. 2 | -------------------------------------------------------------------------------- /shiny-examples-master/004-mpg/Readme.md: -------------------------------------------------------------------------------- 1 | This example demonstrates the following concepts: 2 | 3 | - **Global variables**: The `mpgData` variable is declared outside of the `ui` and `server` function definitions. This makes it available anywhere inside `app.R`. The code in `app.R` outside of `ui` and `server` function definitions is only run once when the app starts up, so it can't contain user input. 4 | - **Reactive expressions**: `formulaText` is a reactive expression. Note how it re-evaluates when the Variable field is changed, but not when the Show Outliers box is unchecked. 5 | -------------------------------------------------------------------------------- /shiny-examples-master/023-optgroup-server/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | Titanic2 <- as.data.frame(Titanic, stringsAsFactors = FALSE) 4 | Titanic2 <- cbind(Titanic2, value = seq_len(nrow(Titanic2))) 5 | Titanic2$label <- apply(Titanic2[, 2:4], 1, paste, collapse = ', ') 6 | updateSelectizeInput(session, 'group', choices = Titanic2, server = TRUE) 7 | 8 | output$row <- renderPrint({ 9 | validate(need( 10 | input$group, 'Please type and search (e.g. Female)' 11 | )) 12 | Titanic2[as.integer(input$group), -(6:7)] 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /shiny-examples-master/032-client-data-and-query-string/README.md: -------------------------------------------------------------------------------- 1 | The `session$clientdata` object provides the server with some information about the client. 2 | 3 | If the client is visiting a URL with a query string or hash (such as http://localhost:8100/?a=xxx&b=yyy#zzz), there will be values for `url_search` and `url_hash_initial`. This app will also display the parsed query string. 4 | 5 | This app in the Shiny gallery is displayed without a query string. To see the query string, follow [this link](https://gallery.shinyapps.io/032-client-data-and-query-string/?a=xxx&b=yyy#zzz). 6 | -------------------------------------------------------------------------------- /shiny-examples-master/128-plot-dim-error/app.R: -------------------------------------------------------------------------------- 1 | # Test for https://github.com/rstudio/shiny/issues/1964 2 | 3 | library(shiny) 4 | 5 | ui <- fluidPage( 6 | p("Verify that this app doesn't crash on startup, and that Go draws a plot."), 7 | actionButton("go", "Go"), 8 | plotOutput("plot") 9 | ) 10 | 11 | server <- function(input, output, session) { 12 | w <- eventReactive(input$go, { 400 }) 13 | h <- eventReactive(input$go, { 400 }) 14 | 15 | output$plot <- renderPlot({ 16 | plot(cars) 17 | }, width = w, height = h) 18 | } 19 | 20 | shinyApp(ui, server) 21 | 22 | -------------------------------------------------------------------------------- /shiny-examples-master/048-including-html-text-and-markdown-files/include.md: -------------------------------------------------------------------------------- 1 | This file is include.md 2 | ======================= 3 | 4 | The content of this file is: 5 | 6 | * Processed with the markdown package, which transforms it into HTML. 7 | * The output is included in the web page. 8 | 9 | ## Including code 10 | 11 | In the .md file, R code is highlighted, and code can be included inline with backticks, as in `sum(1:10)`. However, this is *not* an .Rmd file, and the code will not be executed by knitr. 12 | 13 | ```{r} 14 | # Some example code 15 | x <- 12 16 | x + 1 17 | ``` 18 | -------------------------------------------------------------------------------- /shiny-examples-master/070-widget-checkbox/README.md: -------------------------------------------------------------------------------- 1 | 2 | checkboxInput(inputId, label, value = FALSE) 3 | 4 | Creates a single checkbox. The widget sends the server `TRUE` if the box is checked, `FALSE` otherwise. 5 | 6 | ##### Arguments 7 | 8 | `inputId` 9 | The name to use to look up the value of the widget (as a character string) 10 | 11 | `label` 12 | A label to display next to the checkbox 13 | 14 | `value` 15 | A logical value. If `TRUE`, the checkbox will begin checked. If `FALSE`, it will begin unchecked. 16 | 17 | _Make this widget by copying the code in ui.R._ 18 | -------------------------------------------------------------------------------- /shiny-examples-master/083-front-page/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | output$main_plot <- renderPlot({ 4 | 5 | hist(faithful$eruptions, 6 | probability = TRUE, 7 | breaks = as.numeric(input$n_breaks), 8 | xlab = "Duration (minutes)", 9 | main = "Geyser eruption duration") 10 | 11 | if (input$individual_obs) { 12 | rug(faithful$eruptions) 13 | } 14 | 15 | if (input$density) { 16 | dens <- density(faithful$eruptions, 17 | adjust = input$bw_adjust) 18 | lines(dens, col = "blue") 19 | } 20 | 21 | }) 22 | } -------------------------------------------------------------------------------- /shiny-examples-master/117-shinythemes/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates the themes available in the [shinythemes](http://rstudio.github.io/shinythemes/) package. You can select a theme by using the selector in the upper right. 2 | 3 | Once you've found a theme that you like, you can use it in your app by passing the argument `theme = shinythemes::shinytheme("theme_name")` (where you replace `theme_name` with the theme that you want) to the top-level page function in your app. The top-level page function in your app will be one of `fluidPage()`, `bootstrapPage()`, `navbarPage()`, or `fixedPage()`. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/086-bus-dashboard/README.md: -------------------------------------------------------------------------------- 1 | The script in the `metrotransit-data/` directory will fetch schedule data for the Twin Cities Metro Transit. This data is updated weekly. 2 | 3 | The 00-fetch-data.R script should be executed in the `metrotransit-data/` directory. It fetches the data and saves some of the tables as .rds files. The bus app will read in the .rds files for route information. 4 | 5 | Information about schedule data: http://datafinder.org/metadata/transit_schedule_google_feed.html 6 | 7 | Data format reference: https://developers.google.com/transit/gtfs/reference?csw=1 8 | -------------------------------------------------------------------------------- /shiny-examples-master/091-action-pattern4/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- fluidPage( 4 | actionButton("runif", "Uniform"), 5 | actionButton("reset", "Clear"), 6 | hr(), 7 | plotOutput("plot") 8 | ) 9 | 10 | server <- function(input, output){ 11 | v <- reactiveValues(data = NULL) 12 | 13 | observeEvent(input$runif, { 14 | v$data <- runif(100) 15 | }) 16 | 17 | observeEvent(input$reset, { 18 | v$data <- NULL 19 | }) 20 | 21 | output$plot <- renderPlot({ 22 | if (is.null(v$data)) return() 23 | hist(v$data) 24 | }) 25 | } 26 | 27 | shinyApp(ui, server) -------------------------------------------------------------------------------- /shiny-examples-master/098-plot-interaction-article-3/app.R: -------------------------------------------------------------------------------- 1 | ui <- basicPage( 2 | plotOutput("plot1", click = "plot_click"), 3 | verbatimTextOutput("info") 4 | ) 5 | 6 | server <- function(input, output) { 7 | output$plot1 <- renderPlot({ 8 | plot(mtcars$wt, mtcars$mpg) 9 | }) 10 | 11 | output$info <- renderPrint({ 12 | # With base graphics, need to tell it what the x and y variables are. 13 | nearPoints(mtcars, input$plot_click, xvar = "wt", yvar = "mpg") 14 | # nearPoints() also works with hover and dblclick events 15 | }) 16 | } 17 | 18 | shinyApp(ui, server) 19 | -------------------------------------------------------------------------------- /shiny-examples-master/177-jquery-1/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | options(shiny.jquery.version = 1) 4 | onStop(function() { 5 | options(shiny.jquery.version = NULL) 6 | }) 7 | 8 | ui <- fluidPage( 9 | p(HTML("This test verifies that app authors can opt into using jQuery 1 using options(shiny.jquery.version).")), 10 | p("The number below is the jQuery version number. It should begin with a 1."), 11 | tags$script(HTML(" 12 | document.write(jQuery.fn.jquery); 13 | ")) 14 | ) 15 | 16 | server <- function(input, output, session) { 17 | 18 | } 19 | 20 | shinyApp(ui, server) 21 | -------------------------------------------------------------------------------- /shiny-examples-master/090-action-pattern3/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- fluidPage( 4 | actionButton("runif", "Uniform"), 5 | actionButton("rnorm", "Normal"), 6 | hr(), 7 | plotOutput("plot") 8 | ) 9 | 10 | server <- function(input, output){ 11 | v <- reactiveValues(data = NULL) 12 | 13 | observeEvent(input$runif, { 14 | v$data <- runif(100) 15 | }) 16 | 17 | observeEvent(input$rnorm, { 18 | v$data <- rnorm(100) 19 | }) 20 | 21 | output$plot <- renderPlot({ 22 | if (is.null(v$data)) return() 23 | hist(v$data) 24 | }) 25 | } 26 | 27 | shinyApp(ui, server) -------------------------------------------------------------------------------- /shiny-examples-master/019-mathjax/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | title = 'MathJax Examples', 3 | withMathJax(), 4 | helpText('An irrational number \\(\\sqrt{2}\\) 5 | and a fraction $$1-\\frac{1}{2}$$'), 6 | helpText('and a fact about \\(\\pi\\): 7 | $$\\frac2\\pi = \\frac{\\sqrt2}2 \\cdot 8 | \\frac{\\sqrt{2+\\sqrt2}}2 \\cdot 9 | \\frac{\\sqrt{2+\\sqrt{2+\\sqrt2}}}2 \\cdots$$'), 10 | uiOutput('ex1'), 11 | uiOutput('ex2'), 12 | uiOutput('ex3'), 13 | uiOutput('ex4'), 14 | checkboxInput('ex5_visible', 'Show Example 5', FALSE), 15 | uiOutput('ex5') 16 | ) 17 | -------------------------------------------------------------------------------- /shiny-examples-master/079-widget-submit/README.md: -------------------------------------------------------------------------------- 1 | 2 | submitButton(text = "Apply Changes", icon = NULL) 3 | 4 | 5 | Creates a submit button. Apps that use a submit button do not update their output as soon as a user makes a change, rather they wait until the user clicks the submit button. This can be a useful way to let your user make several changes and then apply them all at once. 6 | 7 | ##### Arguments 8 | 9 | `text` 10 | A character string to display in the button 11 | 12 | `icon` 13 | An optional icon to appear in the button 14 | 15 | _Make this widget by copying the code in ui.R._ 16 | -------------------------------------------------------------------------------- /shiny-examples-master/108-module-output/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | source("linked_scatter.R") 4 | 5 | ui <- fixedPage( 6 | h2("Module example"), 7 | linkedScatterUI("scatters"), 8 | textOutput("summary") 9 | ) 10 | 11 | server <- function(input, output, session) { 12 | df <- callModule(linkedScatter, "scatters", reactive(mpg), 13 | left = reactive(c("cty", "hwy")), 14 | right = reactive(c("drv", "hwy")) 15 | ) 16 | 17 | output$summary <- renderText({ 18 | sprintf("%d observation(s) selected", nrow(dplyr::filter(df(), selected_))) 19 | }) 20 | } 21 | 22 | shinyApp(ui, server) 23 | -------------------------------------------------------------------------------- /shiny-examples-master/062-submitbutton-demo/README.md: -------------------------------------------------------------------------------- 1 | When a `submitButton` is present in a Shiny application, it causes **all** the inputs on the page to not send updates to the server until the button is pressed. 2 | 3 | Because a `submitButton` alters the behavior of all other inputs on the page, we generally recommend **not** using `submitButton`, and using `actionButton` instead. In most cases, it is best not to use `submitButton`, but instead to use `actionButton`, since it allows finer-grained control over which inputs will trigger re-execution of code. See the `actionButton` demo in the gallery for more information. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/025-loop-ui/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | # note we use the syntax input[['foo']] instead of input$foo, because we have 4 | # to construct the id as a character string, then use it to access the value; 5 | # same thing applies to the output object below 6 | output$a_out <- renderPrint({ 7 | res <- lapply(1:5, function(i) input[[paste0('a', i)]]) 8 | str(setNames(res, paste0('a', 1:5))) 9 | }) 10 | 11 | lapply(1:10, function(i) { 12 | output[[paste0('b', i)]] <- renderUI({ 13 | strong(paste0('Hi, this is output B#', i)) 14 | }) 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /shiny-examples-master/059-reactive-poll-and-file-reader/README.md: -------------------------------------------------------------------------------- 1 | There are three main parts of the server code: 2 | 3 | 1. The first sets up an observer which writes to a log file once every second. This is just to make the example work; typically some external process will be writing to a file. 4 | 5 | 1. The second part uses a `reactiveFileReader` to monitor the log file for changes every 0.5 seconds. 6 | 7 | 1. The third part uses a `reactivePoll` to monitor the log file for changes every 4 seconds. The `reactivePoll` is general, and it will watch for things other than file changes. It could, for example, query a database. 8 | -------------------------------------------------------------------------------- /shiny-examples-master/087-crandash/README.md: -------------------------------------------------------------------------------- 1 | # crandash 2 | 3 | Demo of dashboard with streaming updates, using [Shiny](http://shiny.rstudio.com). 4 | 5 | The streaming data is a 1-week-delayed livestream of download logs from cran.rstudio.com. The server code for that service is at [jcheng5/cransim](https://github.com/jcheng5/cransim). 6 | 7 | ## Installation 8 | 9 | ```r 10 | install.packages(c("shiny", "dplyr", "htmlwidgets", "digest", "bit")) 11 | devtools::install_github("rstudio/shinydashboard") 12 | devtools::install_github("jcheng5/bubbles") 13 | devtools::install_github("hadley/shinySignals") 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /shiny-examples-master/131-renderplot-args/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | ui <- withTags(fluidPage( 4 | h3("Test of additional renderPlot args"), 5 | ol( 6 | li("The background of the plot should be the same color as the page background."), 7 | li("Try resizing the browser's width, make sure it's transparent even after redraw.") 8 | ), 9 | style("body { background-color: #A3E4D7; }"), 10 | plotOutput("plot") 11 | )) 12 | 13 | server <- function(input, output, session) { 14 | output$plot <- renderPlot({ 15 | par(bg = NA) 16 | plot(cars) 17 | }, bg = NA) 18 | } 19 | 20 | shinyApp(ui, server) 21 | -------------------------------------------------------------------------------- /shiny-examples-master/030-basic-datatable/server.R: -------------------------------------------------------------------------------- 1 | # Load the ggplot2 package which provides 2 | # the 'mpg' dataset. 3 | library(ggplot2) 4 | 5 | function(input, output) { 6 | 7 | # Filter data based on selections 8 | output$table <- DT::renderDataTable(DT::datatable({ 9 | data <- mpg 10 | if (input$man != "All") { 11 | data <- data[data$manufacturer == input$man,] 12 | } 13 | if (input$cyl != "All") { 14 | data <- data[data$cyl == input$cyl,] 15 | } 16 | if (input$trans != "All") { 17 | data <- data[data$trans == input$trans,] 18 | } 19 | data 20 | })) 21 | 22 | } 23 | -------------------------------------------------------------------------------- /002-text/002-text-golem/R/app_server.R: -------------------------------------------------------------------------------- 1 | #' @import shiny 2 | app_server <- function(input, output, session) { 3 | 4 | # Return the requested dataset ---- 5 | datasetInput <- reactive({ 6 | switch(input$dataset, 7 | "rock" = rock, 8 | "pressure" = pressure, 9 | "cars" = cars 10 | ) 11 | }) 12 | 13 | # Generate a summary of the dataset ---- 14 | output$summary <- renderPrint({ 15 | dataset <- datasetInput() 16 | summary(dataset) 17 | }) 18 | 19 | # Show the first "n" observations ---- 20 | output$view <- renderTable({ 21 | head(datasetInput(), n = input$obs) 22 | }) 23 | } 24 | -------------------------------------------------------------------------------- /shiny-examples-master/061-server-to-client-custom-messages/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel("sendCustomMessage example"), 3 | 4 | fluidRow( 5 | column(4, wellPanel( 6 | sliderInput("controller", "Controller:", 7 | min = 1, max = 20, value = 15), 8 | 9 | # This makes web page load the JS file in the HTML head. 10 | # The call to singleton ensures it's only included once 11 | # in a page. It's not strictly necessary in this case, but 12 | # it's good practice. 13 | singleton( 14 | tags$head(tags$script(src = "message-handler.js")) 15 | ) 16 | )) 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /shiny-examples-master/077-widget-slider/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | fluidRow( 3 | column(4, 4 | 5 | # Copy the line below to make a slider bar 6 | sliderInput("slider1", label = h3("Slider"), min = 0, 7 | max = 100, value = 50) 8 | ), 9 | column(4, 10 | 11 | # Copy the line below to make a slider range 12 | sliderInput("slider2", label = h3("Slider Range"), min = 0, 13 | max = 100, value = c(40, 60)) 14 | ) 15 | ), 16 | 17 | hr(), 18 | 19 | fluidRow( 20 | column(4, verbatimTextOutput("value")), 21 | column(4, verbatimTextOutput("range")) 22 | ) 23 | 24 | ) 25 | -------------------------------------------------------------------------------- /shiny-examples-master/171-path-traversal/app.R: -------------------------------------------------------------------------------- 1 | shinyApp( 2 | fluidPage( 3 | p( 4 | "Click on each of the links below. They should report that the file is not found, or is forbidden.", 5 | "(For issues ", a("httpuv#235", href = "https://github.com/rstudio/httpuv/pull/235"), 6 | "and ", a("shiny#2566", href = "https://github.com/rstudio/shiny/pull/2566", .noWS = "after"), ")", 7 | ), 8 | a("Link 1", href = "/shared/..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cwindows%5cwin.ini"), 9 | br(), 10 | a("Link 2", href = "/shared/../../../../../../../../etc/passwd") 11 | ), 12 | function(input, output) {} 13 | ) 14 | -------------------------------------------------------------------------------- /001-hello/001-hello-golem/dev/03_deploy.R: -------------------------------------------------------------------------------- 1 | # Deploy a Prod-Ready, Robust Shiny Application. 2 | # 3 | # 4. Test my package 4 | 5 | devtools::test() 6 | rhub::check_for_cran() 7 | 8 | # 5. Deployment elements 9 | 10 | ## 5.1 If you want to deploy on RStudio related platforms 11 | golem::add_rstudioconnect_file() 12 | golem::add_shinyappsio_file() 13 | golem::add_shinyserver_file() 14 | 15 | ## 5.2 If you want to deploy via a generic Dockerfile 16 | golem::add_dockerfile() 17 | 18 | ## 5.2 If you want to deploy to ShinyProxy 19 | golem::add_dockerfile_shinyproxy() 20 | 21 | ## 5.2 If you want to deploy to Heroku 22 | golem::add_dockerfile_heroku() 23 | -------------------------------------------------------------------------------- /002-text/002-text-golem/dev/03_deploy.R: -------------------------------------------------------------------------------- 1 | # Deploy a Prod-Ready, Robust Shiny Application. 2 | # 3 | # 4. Test my package 4 | 5 | devtools::test() 6 | rhub::check_for_cran() 7 | 8 | # 5. Deployment elements 9 | 10 | ## 5.1 If you want to deploy on RStudio related platforms 11 | golem::add_rstudioconnect_file() 12 | golem::add_shinyappsio_file() 13 | golem::add_shinyserver_file() 14 | 15 | ## 5.2 If you want to deploy via a generic Dockerfile 16 | golem::add_dockerfile() 17 | 18 | ## 5.2 If you want to deploy to ShinyProxy 19 | golem::add_dockerfile_shinyproxy() 20 | 21 | ## 5.2 If you want to deploy to Heroku 22 | golem::add_dockerfile_heroku() 23 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/dev/03_deploy.R: -------------------------------------------------------------------------------- 1 | # Deploy a Prod-Ready, Robust Shiny Application. 2 | # 3 | # 4. Test my package 4 | 5 | devtools::test() 6 | rhub::check_for_cran() 7 | 8 | # 5. Deployment elements 9 | 10 | ## 5.1 If you want to deploy on RStudio related platforms 11 | golem::add_rstudioconnect_file() 12 | golem::add_shinyappsio_file() 13 | golem::add_shinyserver_file() 14 | 15 | ## 5.2 If you want to deploy via a generic Dockerfile 16 | golem::add_dockerfile() 17 | 18 | ## 5.2 If you want to deploy to ShinyProxy 19 | golem::add_dockerfile_shinyproxy() 20 | 21 | ## 5.2 If you want to deploy to Heroku 22 | golem::add_dockerfile_heroku() 23 | -------------------------------------------------------------------------------- /shiny-dashboard/shiny-dashboard-golem/dev/03_deploy.R: -------------------------------------------------------------------------------- 1 | # Deploy a Prod-Ready, Robust Shiny Application. 2 | # 3 | # 4. Test my package 4 | 5 | devtools::test() 6 | rhub::check_for_cran() 7 | 8 | # 5. Deployment elements 9 | 10 | ## 5.1 If you want to deploy on RStudio related platforms 11 | golem::add_rstudioconnect_file() 12 | golem::add_shinyappsio_file() 13 | golem::add_shinyserver_file() 14 | 15 | ## 5.2 If you want to deploy via a generic Dockerfile 16 | golem::add_dockerfile() 17 | 18 | ## 5.2 If you want to deploy to ShinyProxy 19 | golem::add_dockerfile_shinyproxy() 20 | 21 | ## 5.2 If you want to deploy to Heroku 22 | golem::add_dockerfile_heroku() 23 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/test/teststyle.css: -------------------------------------------------------------------------------- 1 | body { 2 | overflow-y:scroll; 3 | font-family: arial; 4 | } 5 | 6 | text { 7 | font: 12px sans-serif; 8 | } 9 | 10 | .chart { 11 | float:left; 12 | height: 500px; 13 | text-align: center; 14 | font-weight: bold; 15 | margin-bottom: 2em; 16 | } 17 | .chart.full { 18 | width: 100%; 19 | } 20 | 21 | .chart.half { 22 | width: 50%; 23 | } 24 | 25 | .chart.third { 26 | width: 33%; 27 | } 28 | 29 | .chart.selected { 30 | width: 100% !important; 31 | } 32 | 33 | .navigation a{ 34 | margin-right: 1em; 35 | } 36 | 37 | .navigation { 38 | margin-bottom: 1em; 39 | } 40 | -------------------------------------------------------------------------------- /shiny-examples-master/068-widget-action-button/README.md: -------------------------------------------------------------------------------- 1 | 2 | actionButton(inputId, label, icon = NULL) 3 | 4 | Creates an action button whose value is initially zero. The value advances by one each time the button is pressed. This change can spur an action, even if your app does not directly use the value. 5 | 6 | ##### Arguments 7 | 8 | `inputId` 9 | The name to use to look up the value of the widget (as a character string) 10 | 11 | `label` 12 | The label to display in the button. This can also be an HTML element such as an image. 13 | 14 | `icon` 15 | Optional icon to appear on the button 16 | 17 | _Make this widget by copying the code in ui.R._ 18 | -------------------------------------------------------------------------------- /shiny-examples-master/055-observer-demo/README.md: -------------------------------------------------------------------------------- 1 | `output` variables are used to send information to client to display, and in most cases, they are all that's needed for an app. In some cases, though, you need more flexibility in what the server does in response to inputs. 2 | 3 | When you set an `output` variable to a value, that value is sent to the client to be displayed. In contrast, observers don't (by default) send anything to the client. Their purpose is simply to execute R code. For example, observers can be used to write to files or databases. They can also be used send custom messages to the client -- these are messages that don't fit into the normal `output` model. 4 | -------------------------------------------------------------------------------- /shiny-examples-master/112-generate-report/report.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Dynamic report" 3 | output: html_document 4 | params: 5 | n: NA 6 | --- 7 | 8 | ```{r eval = FALSE, echo = FALSE} 9 | # For PDF output, change the header to have "output: pdf_document". 10 | # 11 | # Note that due to an issue in rmarkdown, the default value of a parameter in 12 | # the header cannot be `NULL`, so I used a default of `NA` for the default value 13 | # of `n`. 14 | ``` 15 | 16 | 17 | ```{r} 18 | # The `params` object is available in the document. 19 | params$n 20 | ``` 21 | 22 | A plot of `params$n` random points. 23 | 24 | ```{r} 25 | plot(rnorm(params$n), rnorm(params$n)) 26 | ``` 27 | -------------------------------------------------------------------------------- /shiny-examples-master/136-plot-cache/app.R: -------------------------------------------------------------------------------- 1 | shinyApp( 2 | 3 | fluidPage( 4 | sidebarLayout( 5 | sidebarPanel( 6 | sliderInput("n", "Number of points", 4, 32, value = 8, step = 4) 7 | ), 8 | mainPanel(plotOutput("plot")) 9 | ) 10 | ), 11 | 12 | function(input, output, session) { 13 | output$plot <- renderCachedPlot( 14 | { 15 | Sys.sleep(2) # Add an artificial delay 16 | 17 | rownums <- seq_len(input$n) 18 | plot(cars$speed[rownums], cars$dist[rownums], 19 | xlim = range(cars$speed), ylim = range(cars$dist)) 20 | }, 21 | cacheKeyExpr = {input$n } 22 | ) 23 | } 24 | ) 25 | -------------------------------------------------------------------------------- /shiny-examples-master/006-tabsets/Readme.md: -------------------------------------------------------------------------------- 1 | This example demonstrates the `tabsetPanel` and `tabPanel` widgets. 2 | 3 | Notice that outputs that are not visible are not re-evaluated until they become visible. Try this: 4 | 5 | 1. Scroll to the bottom of the `server` function. You might need to use the *show with app* option so you can easily view the code and interact with the app at the same time. 6 | 2. Change the number of observations, and observe that only `output$plot` is evaluated. 7 | 3. Click the Summary tab, and observe that `output$summary` is evaluated. 8 | 4. Change the number of observations again, and observe that now only `output$summary` is evaluated. 9 | 10 | -------------------------------------------------------------------------------- /060-retirement-simulation/060-retirement-simulation-golem/dev/03_deploy.R: -------------------------------------------------------------------------------- 1 | # Deploy a Prod-Ready, Robust Shiny Application. 2 | # 3 | # 4. Test my package 4 | 5 | devtools::test() 6 | rhub::check_for_cran() 7 | 8 | # 5. Deployment elements 9 | 10 | ## 5.1 If you want to deploy on RStudio related platforms 11 | golem::add_rstudioconnect_file() 12 | golem::add_shinyappsio_file() 13 | golem::add_shinyserver_file() 14 | 15 | ## 5.2 If you want to deploy via a generic Dockerfile 16 | golem::add_dockerfile() 17 | 18 | ## 5.2 If you want to deploy to ShinyProxy 19 | golem::add_dockerfile_shinyproxy() 20 | 21 | ## 5.2 If you want to deploy to Heroku 22 | golem::add_dockerfile_heroku() 23 | -------------------------------------------------------------------------------- /shiny-examples-master/033-conditionalpanel-demo/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | 3 | titlePanel("Conditional panels"), 4 | 5 | column(4, wellPanel( 6 | sliderInput("n", "Number of points:", 7 | min = 10, max = 200, value = 50, step = 10) 8 | )), 9 | 10 | column(5, 11 | "The plot below will be not displayed when the slider value", 12 | "is less than 50.", 13 | 14 | # With the conditionalPanel, the condition is a JavaScript 15 | # expression. In these expressions, input values like 16 | # input$n are accessed with dots, as in input.n 17 | conditionalPanel("input.n >= 50", 18 | plotOutput("scatterPlot", height = 300) 19 | ) 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /shiny-examples-master/063-superzip-example/README.md: -------------------------------------------------------------------------------- 1 | # SuperZIP demo 2 | 3 | See a version of it live at http://shiny.rstudio.com/gallery/superzip-example.html 4 | 5 | You can run this demo with: 6 | ``` 7 | if (!require(devtools)) 8 | install.packages("devtools") 9 | devtools::install_github("rstudio/leaflet") 10 | shiny::runGitHub("rstudio/shiny-examples", subdir="063-superzip-example") 11 | ``` 12 | 13 | Data compiled for _Coming Apart: The State of White America, 1960–2010_ by Charles Murray (Crown Forum, 2012). This app was inspired by the Washington Post's interactive feature _[Washington: A world apart](http://www.washingtonpost.com/sf/local/2013/11/09/washington-a-world-apart/)_. 14 | -------------------------------------------------------------------------------- /shiny-examples-master/022-unicode-chinese/ui.R: -------------------------------------------------------------------------------- 1 | # 定义用户界面 2 | fluidPage( 3 | 4 | # 标题 5 | titlePanel("麻麻再也不用担心我的Shiny应用不能显示中文了"), 6 | 7 | # 侧边栏布局 8 | sidebarLayout( 9 | sidebarPanel( 10 | selectInput("dataset", "请选一个数据:", 11 | choices = c("岩石", "pressure", "cars")), 12 | 13 | uiOutput("rockvars"), 14 | 15 | numericInput("obs", "查看多少行数据?", 5), 16 | 17 | checkboxInput("summary", "显示概要", TRUE) 18 | ), 19 | 20 | # 展示一个HTML表格 21 | mainPanel( 22 | conditionalPanel("input.dataset === '岩石'", plotOutput("rockplot")), 23 | 24 | verbatimTextOutput("summary这里也可以用中文"), 25 | 26 | tableOutput("view") 27 | ) 28 | ) 29 | ) 30 | -------------------------------------------------------------------------------- /shiny-examples-master/035-custom-input-bindings/README.md: -------------------------------------------------------------------------------- 1 | Shiny comes with several types of inputs out of the box. You may find time when it would be useful to implement your own input bindings. 2 | 3 | In this example, we've created an input binding for inputs with `type=url` (which requires a modern browser). This input binding is based on Shiny's built-in textInputBinding. URL behave very similary to regular text inputs, so you won't see any new features over and above what a textInputBinding will do. Still, the code demonstrates what's needed for writing your own input bindings. 4 | 5 | This example application has files other than server.R and ui.R. To see them, make sure to see the full source code. 6 | -------------------------------------------------------------------------------- /shiny-examples-master/094-image-interaction-basic/README.md: -------------------------------------------------------------------------------- 1 | This app demonstrates basic interactions with a dynamically-generated PNG image, which has a grid of lines spaced by 10 pixels. 2 | 3 | With `imageOutput`, Shiny provides pixel coordinates. This is in contrast to `plotOutput`, for which Shiny provides coordinates that are scaled to the data values. 4 | 5 | Note that depending on your browser window's width, you may see non-integer values for `x` or `y`. This is because, although the mouse cursor always has an integer-valued position, the image itself may have a non-integer position. You can see the image position in most web browsers by opening the Javascript console and running `$('#image1').offset()`. 6 | -------------------------------------------------------------------------------- /shiny-examples-master/050-kmeans-example/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | # Combine the selected variables into a new data frame 4 | selectedData <- reactive({ 5 | iris[, c(input$xcol, input$ycol)] 6 | }) 7 | 8 | clusters <- reactive({ 9 | kmeans(selectedData(), input$clusters) 10 | }) 11 | 12 | output$plot1 <- renderPlot({ 13 | palette(c("#E41A1C", "#377EB8", "#4DAF4A", "#984EA3", 14 | "#FF7F00", "#FFFF33", "#A65628", "#F781BF", "#999999")) 15 | 16 | par(mar = c(5.1, 4.1, 0, 1)) 17 | plot(selectedData(), 18 | col = clusters()$cluster, 19 | pch = 20, cex = 3) 20 | points(clusters()$centers, pch = 4, cex = 4, lwd = 4) 21 | }) 22 | 23 | } 24 | -------------------------------------------------------------------------------- /shiny-examples-master/059-reactive-poll-and-file-reader/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel("reactivePoll and reactiveFileReader"), 3 | fluidRow( 4 | column(12, 5 | p("This app has a log file which is appended to", 6 | "every second.") 7 | ) 8 | ), 9 | fluidRow( 10 | column(6, wellPanel( 11 | "This side uses a reactiveFileReader, which is monitoring", 12 | "the log file for changes every 0.5 seconds.", 13 | verbatimTextOutput("fileReaderText") 14 | )), 15 | 16 | column(6, wellPanel( 17 | "This side uses a reactivePoll, which is monitoring", 18 | "the log file for changes every 4 seconds.", 19 | verbatimTextOutput("pollText") 20 | )) 21 | ) 22 | ) 23 | -------------------------------------------------------------------------------- /shiny-examples-master/063-superzip-example/global.R: -------------------------------------------------------------------------------- 1 | library(dplyr) 2 | 3 | allzips <- readRDS("data/superzip.rds") 4 | allzips$latitude <- jitter(allzips$latitude) 5 | allzips$longitude <- jitter(allzips$longitude) 6 | allzips$college <- allzips$college * 100 7 | allzips$zipcode <- formatC(allzips$zipcode, width=5, format="d", flag="0") 8 | row.names(allzips) <- allzips$zipcode 9 | 10 | cleantable <- allzips %>% 11 | select( 12 | City = city.x, 13 | State = state.x, 14 | Zipcode = zipcode, 15 | Rank = rank, 16 | Score = centile, 17 | Superzip = superzip, 18 | Population = adultpop, 19 | College = college, 20 | Income = income, 21 | Lat = latitude, 22 | Long = longitude 23 | ) 24 | -------------------------------------------------------------------------------- /shiny-examples-master/167-resource-warnings/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | addResourcePath("session", system.file(package = "httpuv")) 4 | addResourcePath("images", system.file(package = "shiny")) 5 | 6 | onStop(function() { 7 | removeResourcePath("session") 8 | removeResourcePath("images") 9 | }) 10 | 11 | ui <- fluidPage( 12 | "You should see two warnings about resource paths in your R console.", 13 | # This image is here to ensure that addResourcePath("images", ...) 14 | # throws a warning when your app has a www/images directory. 15 | img(src = "images/rstudio.png", style = "display:none") 16 | ) 17 | 18 | server <- function(input, output, session) { 19 | 20 | } 21 | 22 | shinyApp(ui, server) 23 | 24 | 25 | -------------------------------------------------------------------------------- /shiny-examples-master/155-index-html-app-r/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

www/index.html with app.R

12 | 13 |

This app tests whether a www/index.html is served when used with app.R, for #2380. It should say "Status: pass" below.

14 | 15 |

16 | Status: 17 | fail 18 |

19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /shiny-examples-master/175-setInputValue/script.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | setTimeout(function() { 3 | Shiny.setInputValue("test_evt", 1, {priority: "event"}); 4 | Shiny.setInputValue("test_evt", 1, {priority: "event"}); 5 | Shiny.setInputValue("test_evt", 1, {priority: "event"}); 6 | Shiny.setInputValue("test_evt", 1, {priority: "event"}); 7 | Shiny.setInputValue("test_evt", 1, {priority: "event"}); 8 | 9 | Shiny.setInputValue("test_val", 1, {priority: "immediate"}); 10 | Shiny.setInputValue("test_val", 1, {priority: "deferred"}); 11 | Shiny.setInputValue("test_val", 1, {priority: "immediate"}); 12 | Shiny.setInputValue("test_val", 1); 13 | Shiny.setInputValue("test_val", 1); 14 | }, 1000); 15 | }); 16 | -------------------------------------------------------------------------------- /shiny-examples-master/154-index-html-server-r/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

www/index.html with app.R

12 | 13 |

This app tests whether a www/index.html is served when used with app.R, for #2380. It should say "Status: pass" below.

14 | 15 |

16 | Status: 17 | fail 18 |

19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /shiny-examples-master/040-dynamic-clustering/ui.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | # Create a bootstrap fluid layout 4 | fluidPage( 5 | 6 | # Add a title 7 | titlePanel("Dynamic Clustering in Shiny"), 8 | 9 | # Add a row for the main content 10 | fluidRow( 11 | 12 | # Create a space for the plot output 13 | plotOutput( 14 | "clusterPlot", "100%", "500px", click="clusterClick" 15 | ) 16 | ), 17 | 18 | # Create a row for additional information 19 | fluidRow( 20 | # Take up 2/3 of the width with this element 21 | mainPanel("Points: ", verbatimTextOutput("numPoints")), 22 | 23 | # And the remaining 1/3 with this one 24 | sidebarPanel(actionButton("clear", "Clear Points")) 25 | ) 26 | ) 27 | -------------------------------------------------------------------------------- /shiny-examples-master/047-image-output/README.md: -------------------------------------------------------------------------------- 1 | The `renderImage()` and `imageOutput()` functions can be used to display any image files on the client. This is in contrast to the `renderPlot()` and `plotOutput()` functions, which are used for images created by R's usual plot rendering device. 2 | 3 | In the upper image, `image1`, a new image file is created each time the slider changes, and the `deleteFile=TRUE` argument tells the server to delete the temporary iamge file after it's sent to the client. 4 | 5 | This technique can be also used for pre-rendered images. The lower image, `image2` sends pre-rendered images to the client. In this case the `deleteFile=FALSE` argument is used so that the image files aren't deleted after being sent to the client. 6 | -------------------------------------------------------------------------------- /shiny-examples-master/082-word-cloud/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | # Application title 3 | titlePanel("Word Cloud"), 4 | 5 | sidebarLayout( 6 | # Sidebar with a slider and selection inputs 7 | sidebarPanel( 8 | selectInput("selection", "Choose a book:", 9 | choices = books), 10 | actionButton("update", "Change"), 11 | hr(), 12 | sliderInput("freq", 13 | "Minimum Frequency:", 14 | min = 1, max = 50, value = 15), 15 | sliderInput("max", 16 | "Maximum Number of Words:", 17 | min = 1, max = 300, value = 100) 18 | ), 19 | 20 | # Show Word Cloud 21 | mainPanel( 22 | plotOutput("plot") 23 | ) 24 | ) 25 | ) 26 | -------------------------------------------------------------------------------- /shiny-examples-master/163-select-factor/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | 3 | # Regression test for https://github.com/rstudio/shiny/pull/2524/ 4 | choices <- factor(setNames(letters, LETTERS)) 5 | 6 | ui <- fluidPage( 7 | title = "Select from Factor", 8 | tags$ol( 9 | tags$li("Select any capital letter from the input below."), 10 | tags$li("You should see your selection reflected, in lower case, in the output area.") 11 | ), 12 | selectInput("letter", "Letters", choices = choices), 13 | tags$h3("Output"), 14 | verbatimTextOutput("selected") 15 | ) 16 | 17 | server <- function(input, output, session) { 18 | output$selected <- renderText({ 19 | sprintf("You selected: %s", input$letter) 20 | }) 21 | } 22 | 23 | shinyApp(ui, server) 24 | -------------------------------------------------------------------------------- /shiny-examples-master/120-goog-index/data/trend_description.csv: -------------------------------------------------------------------------------- 1 | type,text 2 | advert,"The Google Advertising & Marketing Index tracks queries related to marketing, advertising, ads, adsense, constant contact, public relations, etc." 3 | educat,"The Google Education Index tracks queries related to college, education, test, academy, barnes and noble, harvard, etc." 4 | smallbiz,"The Google Small Business Index tracks queries related to small business, make money, franchise, work from home, chamber or commerce, etc." 5 | travel,"The Google Travel Index tracks queries related to airlines, hotels, beach, southwest, las vegas, flights, etc." 6 | unempl,"The Google Unemployment Index tracks queries related to unemployment, food stamps, social security, edd, disability, etc." 7 | -------------------------------------------------------------------------------- /001-hello/readme.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | # 001-hello 6 | 7 | Shiny Example : 8 | 9 | ```{r} 10 | fs::dir_tree('001-hello-original') 11 | ``` 12 | golem Example : 13 | 14 | ```{r} 15 | fs::dir_tree('001-hello-golem') 16 | ``` 17 | 18 | ### Where to put things 19 | 20 | Use [original DESCRIPTION](001-hello-original/DESCRIPTION) in [golem dev/01_start.R](001-hello-golem/dev/01_start.R) 21 | 22 | From [original app.R](001-hello-original/app.R), put the [ui function](001-hello-original/app.R#4) into golem [app_ui.R](001-hello-golem/R/app_ui.R) & the [server function](001-hello-original/app.R#35) into golem [app_server.R](001-hello-golem/R/app_server.R) 23 | 24 | See [002-text](../002-text/) and later for a scripted way to do that.s -------------------------------------------------------------------------------- /shiny-examples-master/099-plot-interaction-article-4/app.R: -------------------------------------------------------------------------------- 1 | library(ggplot2) 2 | ui <- basicPage( 3 | plotOutput("plot1", click = "plot_click"), 4 | verbatimTextOutput("info") 5 | ) 6 | 7 | server <- function(input, output) { 8 | output$plot1 <- renderPlot({ 9 | ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() 10 | }) 11 | 12 | output$info <- renderPrint({ 13 | # With ggplot2, no need to tell it what the x and y variables are. 14 | # threshold: set max distance, in pixels 15 | # maxpoints: maximum number of rows to return 16 | # addDist: add column with distance, in pixels 17 | nearPoints(mtcars, input$plot_click, threshold = 10, maxpoints = 1, 18 | addDist = TRUE) 19 | }) 20 | } 21 | 22 | shinyApp(ui, server) 23 | -------------------------------------------------------------------------------- /shiny-examples-master/141-radiant/README.md: -------------------------------------------------------------------------------- 1 | # [Radiant](https://github.com/radiant-rstats/radiant) 2 | 3 | Radiant is an open-source platform-independent browser-based interface for business analytics in [R](https://www.r-project.org/). The application is based on the [Shiny](https://www.rstudio.com/shiny/) package and can be run locally or on a server. Radiant was developed by Vincent Nijs. Please use the issue tracker on GitHub to suggest enhancements or report problems: https://github.com/radiant-rstats/radiant/issues. For other questions and comments please use radiant@rady.ucsd.edu. 4 | 5 | 6 | # Testing 7 | 8 | Make sure this package loads. Click on multiple tabs to launch their modules 9 | -------------------------------------------------------------------------------- /shiny-examples-master/057-plot-plus-three-columns/server.R: -------------------------------------------------------------------------------- 1 | library(ggplot2) 2 | 3 | function(input, output) { 4 | 5 | dataset <- reactive({ 6 | diamonds[sample(nrow(diamonds), input$sampleSize),] 7 | }) 8 | 9 | output$plot <- renderPlot({ 10 | 11 | p <- ggplot(dataset(), aes_string(x=input$x, y=input$y)) + geom_point() 12 | 13 | if (input$color != 'None') 14 | p <- p + aes_string(color=input$color) 15 | 16 | facets <- paste(input$facet_row, '~', input$facet_col) 17 | if (facets != '. ~ .') 18 | p <- p + facet_grid(facets) 19 | 20 | if (input$jitter) 21 | p <- p + geom_jitter() 22 | if (input$smooth) 23 | p <- p + geom_smooth() 24 | 25 | print(p) 26 | 27 | }) 28 | 29 | } 30 | -------------------------------------------------------------------------------- /002-text/002-text-golem/tests/testthat/test-golem-recommended.R: -------------------------------------------------------------------------------- 1 | context("golem tests") 2 | 3 | library(golem) 4 | 5 | test_that("app ui", { 6 | ui <- app_ui() 7 | expect_shinytaglist(ui) 8 | }) 9 | 10 | test_that("app server", { 11 | server <- app_server 12 | expect_is(server, "function") 13 | }) 14 | 15 | # Configure this test to fit your need 16 | test_that( 17 | "app launches",{ 18 | skip_on_cran() 19 | skip_on_travis() 20 | skip_on_appveyor() 21 | x <- processx::process$new( 22 | "R", 23 | c( 24 | "-e", 25 | "setwd('../../'); pkgload::load_all();run_app()" 26 | ) 27 | ) 28 | Sys.sleep(5) 29 | expect_true(x$is_alive()) 30 | x$kill() 31 | } 32 | ) 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /shiny-examples-master/041-dynamic-ui/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel("Dynamically generated user interface components"), 3 | fluidRow( 4 | 5 | column(3, wellPanel( 6 | selectInput("input_type", "Input type", 7 | c("slider", "text", "numeric", "checkbox", 8 | "checkboxGroup", "radioButtons", "selectInput", 9 | "selectInput (multi)", "date", "daterange" 10 | ) 11 | ) 12 | )), 13 | 14 | column(3, wellPanel( 15 | # This outputs the dynamic UI component 16 | uiOutput("ui") 17 | )), 18 | 19 | column(3, 20 | tags$p("Input type:"), 21 | verbatimTextOutput("input_type_text"), 22 | tags$p("Dynamic input value:"), 23 | verbatimTextOutput("dynamic_value") 24 | ) 25 | ) 26 | ) 27 | -------------------------------------------------------------------------------- /shiny-examples-master/055-observer-demo/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | # Create a random name for the log file 4 | logfilename <- tempfile('logfile', fileext = '.txt') 5 | 6 | output$logfile <- renderText({ 7 | sprintf("Log file: %s", logfilename) 8 | }) 9 | 10 | # This observer adds an entry to the log file every time 11 | # input$n changes. 12 | obs <- observe({ 13 | cat(input$n, '\n', file = logfilename, append = TRUE) 14 | }) 15 | 16 | 17 | session$onSessionEnded(function() { 18 | # When the client ends the session, clean up the log file 19 | # for this session. 20 | unlink(logfilename) 21 | }) 22 | 23 | 24 | output$text <- renderText({ 25 | paste0("The value of input$n is: ", input$n) 26 | }) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-golem/tests/testthat/test-golem-recommended.R: -------------------------------------------------------------------------------- 1 | context("golem tests") 2 | 3 | library(golem) 4 | 5 | test_that("app ui", { 6 | ui <- app_ui() 7 | expect_shinytaglist(ui) 8 | }) 9 | 10 | test_that("app server", { 11 | server <- app_server 12 | expect_is(server, "function") 13 | }) 14 | 15 | # Configure this test to fit your need 16 | test_that( 17 | "app launches",{ 18 | skip_on_cran() 19 | skip_on_travis() 20 | skip_on_appveyor() 21 | x <- processx::process$new( 22 | "R", 23 | c( 24 | "-e", 25 | "setwd('../../'); pkgload::load_all();run_app()" 26 | ) 27 | ) 28 | Sys.sleep(5) 29 | expect_true(x$is_alive()) 30 | x$kill() 31 | } 32 | ) 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /shiny-examples-master/014-onflushed/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | values <- reactiveValues(starting = TRUE) 4 | 5 | session$onFlushed(function() { 6 | values$starting <- FALSE 7 | }) 8 | 9 | output$fast <- renderText({ "This happens right away" }) 10 | output$slow <- renderText({ 11 | if (values$starting) { 12 | invalidateLater(0, session) 13 | return("Please wait for 5 seconds") 14 | } 15 | Sys.sleep(5) # pretend this is time-consuming 16 | "This happens later" 17 | }) 18 | output$slow_plot <- renderPlot({ 19 | if (values$starting) { 20 | invalidateLater(0, session) 21 | return(plot(cars, main = "Please wait for a while")) 22 | } 23 | plot(rnorm(100000), main = "A slow plot") 24 | }) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /shiny-examples-master/064-telephones-by-region/ui.R: -------------------------------------------------------------------------------- 1 | # Rely on the 'WorldPhones' dataset in the datasets 2 | # package (which generally comes preloaded). 3 | library(datasets) 4 | 5 | # Use a fluid Bootstrap layout 6 | fluidPage( 7 | 8 | # Give the page a title 9 | titlePanel("Telephones by region"), 10 | 11 | # Generate a row with a sidebar 12 | sidebarLayout( 13 | 14 | # Define the sidebar with one input 15 | sidebarPanel( 16 | selectInput("region", "Region:", 17 | choices=colnames(WorldPhones)), 18 | hr(), 19 | helpText("Data from AT&T (1961) The World's Telephones.") 20 | ), 21 | 22 | # Create a spot for the barplot 23 | mainPanel( 24 | plotOutput("phonePlot") 25 | ) 26 | 27 | ) 28 | ) 29 | -------------------------------------------------------------------------------- /shiny-examples-master/066-upload-file/server.R: -------------------------------------------------------------------------------- 1 | # By default, the file size limit is 5MB. It can be changed by 2 | # setting this option. Here we'll raise limit to 9MB. 3 | options(shiny.maxRequestSize = 9*1024^2) 4 | 5 | function(input, output) { 6 | output$contents <- renderTable({ 7 | # input$file1 will be NULL initially. After the user selects 8 | # and uploads a file, it will be a data frame with 'name', 9 | # 'size', 'type', and 'datapath' columns. The 'datapath' 10 | # column will contain the local filenames where the data can 11 | # be found. 12 | 13 | inFile <- input$file1 14 | 15 | if (is.null(inFile)) 16 | return(NULL) 17 | 18 | read.csv(inFile$datapath, header = input$header, 19 | sep = input$sep, quote = input$quote) 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /shiny-examples-master/055-observer-demo/ui.R: -------------------------------------------------------------------------------- 1 | fluidPage( 2 | titlePanel("Observer demo"), 3 | mainPanel( 4 | p("This demo writes the value of the slider to a log file. If you can, check the file contents after moving the slider to confirm it's been appended to."), 5 | verbatimTextOutput('logfile'), 6 | fluidRow( 7 | column(4, wellPanel( 8 | sliderInput("n", "N:", 9 | min = 10, max = 1000, value = 200, step = 10) 10 | )), 11 | column(8, 12 | verbatimTextOutput("text"), 13 | br(), 14 | br(), 15 | p("In this example, what's visible in the client isn't", 16 | "what's interesting. The server is writing to a log", 17 | "file each time the slider value changes.") 18 | ) 19 | ) 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /shiny-examples-master/111-insert-ui/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | ## keep track of elements inserted and not yet removed 4 | inserted <- c() 5 | 6 | observeEvent(input$insertBtn, { 7 | btn <- input$insertBtn 8 | id <- paste0('txt', btn) 9 | insertUI( 10 | selector = '#placeholder', 11 | ## wrap element in a div with id for ease of removal 12 | ui = tags$div( 13 | tags$p(paste('Element number', btn)), 14 | id = id 15 | ) 16 | ) 17 | inserted <<- c(id, inserted) 18 | }) 19 | 20 | observeEvent(input$removeBtn, { 21 | removeUI( 22 | ## pass in appropriate div id 23 | selector = paste0('#', inserted[length(inserted)]) 24 | ) 25 | inserted <<- inserted[-length(inserted)] 26 | }) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /003-reactivity/003-reactivity-original/Readme.md: -------------------------------------------------------------------------------- 1 | This example demonstrates a core feature of Shiny: **reactivity**. In the `server` function, a reactive called `datasetInput` is declared. 2 | 3 | Notice that the reactive expression depends on the input expression `input$dataset`, and that it's used by two output expressions: `output$summary` and `output$view`. Try changing the dataset (using *Choose a dataset*) while looking at the reactive and then at the outputs; you will see first the reactive and then its dependencies flash. 4 | 5 | Notice also that the reactive expression doesn't just update whenever anything changes--only the inputs it depends on will trigger an update. Change the "Caption" field and notice how only the `output$caption` expression is re-evaluated; the reactive and its dependents are left alone. 6 | -------------------------------------------------------------------------------- /shiny-examples-master/069-widget-check-group/README.md: -------------------------------------------------------------------------------- 1 | 2 | checkboxGroupInput(inputId, label, choices, selected = NULL) 3 | 4 | Creates a group of checkboxes. The widget sends the server a character vector that contains the values of the selected boxes. 5 | 6 | ##### Arguments 7 | 8 | `inputId` 9 | The name to use to look up the value of the widget (as a character string) 10 | 11 | `label` 12 | A label to display above the check boxes 13 | 14 | `choices` 15 | A list of values. The widget will build a checkbox for each value of the list. If the list has names, these will be displayed next to the checkboxes. Otherwise the values themselves will be displayed. 16 | 17 | `selected` 18 | The values that should initially be selected, if any. 19 | 20 | _Make this widget by copying the code in ui.R._ 21 | -------------------------------------------------------------------------------- /shiny-examples-master/081-widgets-gallery/server.R: -------------------------------------------------------------------------------- 1 | function(input, output) { 2 | 3 | output$actionOut <- renderPrint({ input$action }) 4 | output$checkboxOut <- renderPrint({ input$checkbox }) 5 | output$checkGroupOut <- renderPrint({ input$checkGroup }) 6 | output$dateOut <- renderPrint({ input$date }) 7 | output$datesOut <- renderPrint({ input$dates }) 8 | output$fileOut <- renderPrint({ input$file }) 9 | output$numOut <- renderPrint({ input$num }) 10 | output$radioOut <- renderPrint({ input$radio }) 11 | output$selectOut <- renderPrint({ input$select }) 12 | output$slider1Out <- renderPrint({ input$slider1 }) 13 | output$slider2Out <- renderPrint({ input$slider2 }) 14 | #output$submitOut <- renderPrint({ input$submit }) 15 | output$textOut <- renderPrint({ input$text }) 16 | 17 | } 18 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/test/testScript.js: -------------------------------------------------------------------------------- 1 | //A little snippet of D3 code that creates a button that lets you toggle whether a chart is the only one visible on a page or not. 2 | d3.selectAll(".chart button").on("click",function() { 3 | var thisId = this.parentElement.id; 4 | 5 | var chartContainer = d3.select("#" + thisId); 6 | if (chartContainer.attr("class").match("selected")) 7 | chartContainer.classed("selected",false); 8 | else 9 | chartContainer.classed("selected",true); 10 | 11 | d3.selectAll(".chart").style("display",function() { 12 | if (thisId === this.id) return "block"; 13 | 14 | if (d3.select(this).style("display") === "none") 15 | return "block"; 16 | else 17 | return "none"; 18 | }); 19 | window.onresize(); 20 | }); -------------------------------------------------------------------------------- /shiny-examples-master/083-front-page/ui.R: -------------------------------------------------------------------------------- 1 | bootstrapPage( 2 | 3 | selectInput(inputId = "n_breaks", 4 | label = "Number of bins in histogram (approximate):", 5 | choices = c(10, 20, 35, 50), 6 | selected = 20), 7 | 8 | checkboxInput(inputId = "individual_obs", 9 | label = strong("Show individual observations"), 10 | value = FALSE), 11 | 12 | checkboxInput(inputId = "density", 13 | label = strong("Show density estimate"), 14 | value = FALSE), 15 | 16 | plotOutput(outputId = "main_plot", height = "300px"), 17 | 18 | # Display this only if the density is shown 19 | conditionalPanel(condition = "input.density == true", 20 | sliderInput(inputId = "bw_adjust", 21 | label = "Bandwidth adjustment:", 22 | min = 0.2, max = 2, value = 1, step = 0.2) 23 | ) 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /shiny-examples-master/037-date-and-date-range/server.R: -------------------------------------------------------------------------------- 1 | function(input, output, session) { 2 | 3 | # input$date and others are Date objects. When outputting 4 | # text, we need to convert to character; otherwise it will 5 | # print an integer rather than a date. 6 | output$dateText <- renderText({ 7 | paste("input$date is", as.character(input$date)) 8 | }) 9 | 10 | output$dateText2 <- renderText({ 11 | paste("input$date2 is", as.character(input$date2)) 12 | }) 13 | 14 | output$dateRangeText <- renderText({ 15 | paste("input$dateRange is", 16 | paste(as.character(input$dateRange), collapse = " to ") 17 | ) 18 | }) 19 | 20 | output$dateRangeText2 <- renderText({ 21 | paste("input$dateRange2 is", 22 | paste(as.character(input$dateRange2), collapse = " to ") 23 | ) 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /shiny-examples-master/061-server-to-client-custom-messages/README.md: -------------------------------------------------------------------------------- 1 | Sometimes it's useful to send messages from the server to the client, in a way that can't easily be handled with the usual Shiny output bindings. 2 | 3 | `sendCustomMessage()` sends information from the server to the client. It's typically used inside an `observe()` statement. The message is converted from an R data structure to JSON using `RJSONIO::toJSON()`. 4 | 5 | On the client side, a message handler function must be registered to receive and do something with the message. Here, the Javascript file (in the www/ directory) which registers the handler gets included in the head of the HTML page. (Make sure to look at the full source code to see the Javascript file.) 6 | 7 | In this example, the message handler simply pops up an alert box which displays the content of the message. 8 | -------------------------------------------------------------------------------- /shiny-examples-master/054-nvd3-line-chart-output/www/nvd3/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nvd3", 3 | "version": "1.1.15-beta", 4 | "homepage": "http://www.nvd3.org", 5 | "authors": [ 6 | "Bob Monteverde", 7 | "Tyler Wolf", 8 | "Robin Hu", 9 | "Frank Shao" 10 | ], 11 | "description": "Re-usable charts and chart components for d3.", 12 | "main": ["nv.d3.js", "src/nv.d3.css"], 13 | "keywords": [ 14 | "d3", 15 | "visualization", 16 | "svg", 17 | "charts" 18 | ], 19 | "license": "Apache License, v2.0", 20 | "dependencies": { 21 | "d3": "~3.3.13" 22 | }, 23 | "ignore" : [ 24 | "**/.*", 25 | "node_modules", 26 | "bower_components", 27 | "test", 28 | "tests", 29 | "src/models/*", 30 | "src/*.js", 31 | "lib", 32 | "examples", 33 | "deprecated" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /shiny-examples-master/docker-rsc-deployer/deployApp.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | args <- commandArgs(TRUE) 4 | 5 | if (length(args) == 0) { 6 | cat(sep = "\n", 7 | "Usage: deployApp account server appdir", 8 | "", 9 | "Examples:", 10 | " ./deployApp.R alan rsc.radixu.com 001-hello", 11 | "" 12 | ) 13 | 14 | q() 15 | } 16 | 17 | library(rsconnect) 18 | library(packrat) 19 | 20 | deps <- packrat:::dirDependencies(args[[3]]) 21 | deps <- deps[!"shiny" %in% deps] 22 | if (length(deps) > 0) install.packages(deps) 23 | 24 | packrat::.snapshotImpl(args[[3]], snapshot.sources = FALSE) 25 | 26 | rsconnect::deployApp( 27 | appDir = args[[3]], 28 | appName = args[[3]], 29 | account = args[[1]], 30 | server = args[[2]], 31 | logLevel = 'verbose', 32 | launch.browser = FALSE, 33 | forceUpdate = TRUE 34 | ) 35 | -------------------------------------------------------------------------------- /shiny-examples-master/075-widget-radio/README.md: -------------------------------------------------------------------------------- 1 | 2 | radioButtons(inputId, label, choices, selected = NULL) 3 | 4 | 5 | Creates a set of radio buttons, several buttons only one of which can be pressed at any time. The widget will return the value of the selected button to the server as a character string. 6 | 7 | ##### Arguments 8 | 9 | `inputId` 10 | The name to use to look up the value of the widget (as a character string) 11 | 12 | `label` 13 | A label to display above the buttons 14 | 15 | `choices` 16 | A list of values. The widget will build a button for each value of the list. If the list has names, these will be displayed next to the buttons. Otherwise the values themselves will be displayed. 17 | 18 | `selected` 19 | The value that should initially be selected, defaults to the first value. 20 | 21 | _Make this widget by copying the code in ui.R._ 22 | -------------------------------------------------------------------------------- /shiny-examples-master/051-movie-explorer/README.md: -------------------------------------------------------------------------------- 1 | This is the source code for a movie explorer app which runs on R and Shiny. The data is a subset of data from [OMDb](http://www.omdbapi.com/), which in turn is from IMDb and Rotten Tomatoes. The data is saved in a SQLite database. 2 | 3 | To run it locally, you'll need to install the latest versions of [ggvis](http://ggvis.rstudio.com), [Shiny](http://shiny.rstudio.com), and [dplyr](https://github.com/hadley/dplyr), as well as [RSQLite](http://cran.r-project.org/web/packages/RSQLite/index.html). 4 | 5 | ```r 6 | install.packages(c('shiny', 'ggvis', 'dplyr', 'RSQLite')) 7 | ``` 8 | 9 | You may need to restart R to make sure the newly-installed packages work properly. 10 | 11 | After all these packages are installed, you can run this app by entering the directory, and then running the following in R: 12 | 13 | ```s 14 | shiny::runApp() 15 | ``` 16 | -------------------------------------------------------------------------------- /shiny-examples-master/074-widget-numeric/README.md: -------------------------------------------------------------------------------- 1 | 2 | numericInput(inputId, label, value, min = NA, max = NA, step = NA) 3 | 4 | 5 | Creates a box you can use to enter numeric values. You can type a number or scroll through values with the box's scroll bar. The widget will pass the value shown in the box to the server as a double (e.g. number). 6 | 7 | ##### Arguments 8 | 9 | `inputId` 10 | The name to use to look up the value of the widget (as a character string) 11 | 12 | `label` 13 | A label to display above the number field 14 | 15 | `value` 16 | The initial number to display in the number field 17 | 18 | `min` 19 | The minimum number that can be selected 20 | 21 | `max` 22 | The maximum number that can be selected 23 | 24 | `step` 25 | The amount to increment the value by when a user clicks up or down on the scroll bar. 26 | 27 | _Make this widget by copying the code in ui.R._ 28 | --------------------------------------------------------------------------------