Shiny

DEVELOPING DATA PRODUCTS

Johns Hopkins Bloomberg School of Public Health
Coursera
Ambrosio Q. Tria

Why use Shiny?

The Standard, Static Way

dat <- read.csv("crimeStates.csv", sep=",", header = TRUE, stringsAsFactors = FALSE)
head(dat, 3)
##   Year Population Violent.crime.total Murder.and.nonnegligent.Manslaughter
## 1 2010    4785401               18363                                  275
## 2 2011    4803689               20166                                  299
## 3 2012    4822023               21693                                  342
##   Forcible.rape Robbery Aggravated.assault Violent.Crime.rate
## 1          1355    4864              11869              383.7
## 2          1370    4906              13591              419.8
## 3          1296    5020              15035              449.9
##   Murder.and.nonnegligent.manslaughter.rate Forcible.rape.rate
## 1                                       5.7               28.3
## 2                                       6.2               28.5
## 3                                       7.1               26.9
##   Robbery.rate Aggravated.assault.rate   state
## 1        101.6                   248.0 Alabama
## 2        102.1                   282.9 Alabama
## 3        104.1                   311.8 Alabama

The Cool and Shiny Way

require(googleVis)
T1 <- gvisTable(dat, options=list(width="100%", height=400,
                                  page = "enable"))
print(T1, "chart")

See Shiny in Action!



https://ambroset.shinyapps.io/project

/

#