This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
# Define UI for miles per gallon application | |
shinyUI(pageWithSidebar( | |
# Application title | |
headerPanel("Miles Per Gallon"), | |
# Sidebar with controls to select the variable to plot against mpg | |
# and to specify whether outliers should be included |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("shiny") | |
library("datasets") | |
library("ggplot2") | |
#from here http://web.stanford.edu/~cengel/cgi-bin/anthrospace/building-my-first-shiny-application-with-ggplot | |
# We tweak the "am" field to have nicer factor labels. Since this doesn't | |
# rely on any user inputs we can do this once at startup and then use the | |
# value throughout the lifetime of the application | |
mpgData <- mtcars | |
mpgData$am <- factor(mpgData$am, labels = c("Automatic", "Manual")) |