Exploring R Datasets using Shiny

Paramjot Singh
2017-03-24

Introduction


  • Got bored by looking at mtcars, iris and diamond datasets?
  • Ever wondered what other datasets R has?
  • Want to explore those datasets quickly and efficiently?
  • We have got an app for you!!

Welcome to 'Explore R Datasets'

App Features

Quick help on how to use the app


Two dropdowns to select data and variables


Description of dataset
Interactive data table


Histogram of selected variable

Working Details

  • Launching the app grabs the datasets from R installation using data(package="datasets")
  • It then uses this information to populate the dropdown using selectInput()
  • The data name strings are converted to variable names using get() function
  • The variables in the selected data are displayed using renderUI() and selectInput() functions.
  • After this, histogram is created just as in standard R:
data(CO2)
hist(CO2$uptake,
     col = "dodgerblue4")

plot of chunk demo