Shiny (web framework)

Software for developing web applications

Shiny

Original author(s)| Joe Cheng
Developer(s)| RStudio Inc. (and current renamed company Posit PBC)
Initial release| November 2012; 12 years ago (2012-11)
Stable release|

1.9.1[1]

Repository|

* github.com/rstudio/shiny
* github.com/posit-dev/py-shiny

Written in| R / Python
License| MIT License
Website| shiny.rstudio.com

* Free software portal

Shiny is a web framework for developing web applications (apps), originally in R and since 2022 in python. It is free and open source.[2] It was announced by Joe Cheng, CTO of Posit, formerly RStudio, in 2012.[3] One of the uses of Shiny has been in fast prototyping.[4]

In 2022, a separate implementation Shiny for Python was announced.[5] It is not meant to be a replacement, whereby both implementations will be developed concurrently and may never have all the features of each other. There is also Shinylive that allows running Shiny on the client (i.e., program code does not run on the server, reducing server load to just serving the code itself).[6]

## Features

[edit]

Shiny creates a reactive context wherein the user specifies, through input variables, the circumstances under which computations are re-executed, or graphs (often visualizations) re-rendered; this occurs almost instantaneously. The input variables are evaluated via a user interface which allows the simple creation of widgets such as text boxes, radio buttons, and drop-down lists.[3][7]

There are two main parts to a Shiny file, which may alternatively be stored in two separate files. One is designed to accommodate the user interface, the appearance of which is restricted by the default choices, though can be extended through various other R packages. The other is designed to accommodate the server computations and plot generating code, for which all the built-in facilities of R are available.[3]

## Examples

[edit]

A screenshot of the example app

This is an example of a basic application in R where:[8]

library(shiny)

ui <- fluidPage(
textInput("name", "What is your name?"),
textOutput("greeting")

server <- function(input, output, session) {
output$greeting <- renderText({paste0("Hello ", input$name)})

shinyApp(ui, server)

And the equivalent application written in python:[9]

from shiny import App, reactive, render, ui

app_ui = ui.page_fluid(
ui.input_text("name", "What is your name?"),
ui.output_text("greeting"),

def server(input, output, session):

@render.text
def greeting():
return f"Hello {input.name()}"

app = App(app_ui, server)

And shiny express for python:[10]

from shiny.express import input, render, ui

ui.input_text("name", "What is your name?")

@render.text
def greeting():
return f"Hello {input.name()}"

## Deploying / Hosting Shiny

[edit]

Deploying Shiny (R) can be achieved through several popular methods:

* Shiny Server (Open Source): This option allows on-premises hosting for Shiny applications, giving users control over server configurations without licensing costs. It’s ideal for organizations that want direct server access and control.
* Posit Connect[11] (formerly RStudio Connect): A commercial, on-premises solution offering advanced features like user authentication, scheduled reporting, and support for multiple content types, including Shiny applications and R Markdown.
* shinyapps.io:[12] A cloud-hosted service managed by Posit, providing easy deployment and scaling of Shiny apps without requiring server management. It’s user-friendly, ideal for small teams or solo developers. Hosting a Shiny app on a shinyapps.io server is free up to certain limits but paid tiers are relatively expensive compared to hosting on other cloud computing platforms.[3]

## References

[edit]

1. ^ "Shiny: Web Application Framework for R". 1 August 2024.
2. ^ Doi, Jimmy; Potter, Gail; Wong, Jimmy; Alcaraz, Irvin; Chi, Peter (2016). "Web Application Teaching Tools for Statistics Using R and Shiny". Technology Innovations in Statistics Education. 9 (1). doi:10.5070/T591027492.
3. ^ a b c d Kasprzak, Peter; Mitchell, Lachlan; Kravchuk, Olena; Timmins, Andy (2020). "Six Years of Shiny in Research - Collaborative Development of Web Tools in R" (PDF). The R Journal. 12 (2): 20–42\. doi:10.32614/RJ-2021-004. S2CID 231709443. Retrieved 12 March 2022.20-42&rft.date=2020&rft_id=info:doi/10.32614/RJ-2021-004&rft_id=https://api.semanticscholar.org/CorpusID:231709443#id-name=S2CID&rft.aulast=Kasprzak&rft.aufirst=Peter&rft.au=Mitchell,+Lachlan&rft.au=Kravchuk,+Olena&rft.au=Timmins,+Andy&rft_id=https://journal.r-project.org/archive/2021/RJ-2021-009/RJ-2021-009.pdf&rfr_id=info:sid/en.wikipedia.org:Shiny+(web+framework)" class="Z3988">
4. ^ Li, Yu (2020). "Towards fast prototyping of cloud-based environmental decision support systems for environmental scientists using R Shiny and Docker". Environmental Modelling & Software. 132: 104797. doi:10.1016/j.envsoft.2020.104797. hdl:20.500.11850/431312. S2CID 221823072.
5. ^ Machlis, Sharon (2022-07-27). "RStudio unveils Shiny for Python". InfoWorld. Retrieved 2024-05-17.
6. ^ "Shiny for Python - Shinylive: Shiny + WebAssembly". shiny.rstudio.com. Retrieved 2023-01-30.
7. ^ Kaufman, Aaron R. (30 April 2020). "Implementing novel, flexible, and powerful survey designs in R Shiny". PLOS ONE. 15 (4): e0232424. Bibcode:2020PLoSO..1532424K. doi:10.1371/journal.pone.0232424. PMC 7192460. PMID 32353057.
8. ^ Wickham, Hadley. "Your first Shiny app". Mastering Shiny. Retrieved 25 October 2024.
9. ^ "Shiny for Python - Express vs. Core". Retrieved 28 October 2024.
10. ^ "Shiny for Python - Overview". Retrieved 25 October 2024.
11. ^ "Posit". Posit. Retrieved 2024-11-01.
12. ^ "shinyapps.io". www.shinyapps.io. Retrieved 2022-05-24.

## External links

[edit]

* Official website
* Joe Cheng | Keynote: The Past and Future of Shiny | RStudio (2022) (58:07)

* v
* t
* e

R (programming language)

Features|

* Sweave

Implementations|

* Distributed R
* Microsoft R Open (Revolution R Open)
* Renjin

Packages|

* Bibliometrix
* easystats
* qdap
* lumi
* RGtk2
* Rhea
* Rmetrics
* rnn
* RQDA
* Shiny
* SimpleITK
* Statcheck
* tidyverse
* ggplot2
* dplyr
* knitr

Interfaces|

* Bio7
* Emacs Speaks Statistics
* Java GUI for R
* KH Coder
* Rattle GUI
* R Commander
* RExcel
* RKWard
* RStudio

People|

* Roger Bivand
* Jenny Bryan
* John Chambers
* Peter Dalgaard
* Dirk Eddelbuettel
* Robert Gentleman
* Ross Ihaka
* Thomas Lumley
* Brian D. Ripley
* Julia Silge
* Luke Tierney
* Hadley Wickham
* Yihui Xie

Organisations|

* R Consortium
* Revolution Analytics
* R-Ladies
* Posit PBC (formerly RStudio PBC)

Publications|

* The R Journal

*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template