What is Shiny?
- Shiny is an open source R package that makes it easy to build interactive web apps straight from R.
- You can host standalone apps on a webpage or embed them in R Markdown documents or build dashboards.
- You can also extend your shiny apps with CSS themes, htmlwidgets, and JavaScript actions.
For more information on Shiny you can click here.
What is RStudio?
RStudio is a company that develops free and open tools for R and enterprise-ready professional products for teams to scale and share work.
For more information on RStudio you can click here.
What is R?
R is a programming language and environment for statistical computing and graphics.
For more information on R you can click here.
Shiny has many examples of different types of Data Visualizations. Below are a few pictures of what types of graphs you can make with Shiny.
The graph above shows us movies that were made from 1970 - 2014, that grossed between $0 - $800m, and have a minimum of 10 - 80 rotten tomatoe reviews. You might also notice which movies have won an oscar.
This is just a world cloud of the book A Mid Summer Night's Dream where the words need to have a frequency of 1 - 15 and there can only be a maximum of 100 words that can be shown at one time.
Superzip is an interactive map of the US where you can view which states have superzips (Definition of Superzip: Zip Codes in the US with the highest per capita income and college graduation rates.
Click here to see Shiny gallery and more exmaples of what you can do with Shiny!
Shiny allows you to comfortably learn it's usage by taking you through their tutorials. Which can be found by clicking the following link! Learn Shiny! They offer 2 and a half hours worth of videos and a readable 7 lesson tutorial.
Let's take a look at Lesson 1 "Welcome to Shiny"
If you are new to R you can learn more about it by clicking here.
I will also provide a link to the download page here.
The Steps below are to get R running on your computer and testing Shiny.
Steps:
- Choose server closest to your location.
- Choose which OS you are using.
- Click on the package that follows with which situation you would like to download R for.
- Once downloaded open R and it should look like the below picture or something close to it.

- type
install.packages("shiny"). This will install all shiny packages into R. - Then type
library(shiny)andrunExample("01_hello").

- To exit press
escon your keyboard.
The above steps will open a running example of Hello Shiny.
There are more examples you may run by viewing this document here.
Your results might look like the following below:
Here is the ui object for the Hello Shiny example.
library(shiny)
# Define UI for app that draws a histogram ----
ui <- fluidPage(
# App title ----
titlePanel("Hello Shiny!"),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
# Input: Slider for the number of bins ----
sliderInput(inputId = "bins",
label = "Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Main panel for displaying outputs ----
mainPanel(
# Output: Histogram ----
plotOutput(outputId = "distPlot")
)
)
)
Here is the server function for the Hello Shiny example.
# Define server logic required to draw a histogram ----
server <- function(input, output) {
# Histogram of the Old Faithful Geyser Data ----
# with requested number of bins
# This expression that generates a histogram is wrapped in a call
# to renderPlot to indicate that:
#
# 1. It is "reactive" and therefore should be automatically
# re-executed when inputs (input$bins) change
# 2. Its output type is a plot
output$distPlot <- renderPlot({
x <- faithful$waiting
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = "#75AADB", border = "white",
xlab = "Waiting time to next eruption (in mins)",
main = "Histogram of waiting times")
})
}
Shiny can be used with other libraries in R by inputting library(name_of_library) (Ex: library(shiny)). This will allow use of another library in R. Since you can add multiple libraries in R you can use Shiny with other Javascript libraries such as d3, Leaflet, and Google Charts.
Below are a few links to Shiny and R with other libraries.






