Keith Wheeles
02/09/2016
Of course, to meet assignment requirements first! Assignment instructions were loose, so I set out to create a project that:
Since we are not in Shiny environment, this is adapted to make it run without Shiny support.
data("EuStockMarkets")
wgtEu <- EuStockMarkets # identical data frame
w <- sapply(1:4,function(x) wgtEu[,x]=wgtEu[,x]*100/wgtEu[1,x])
wgtEu[,] <- w[,] # reshape back into data frame
inputdataset = "Raw" # these should come from UI
inputexch = c("DAX","SMI","CAC","FTSE")
plot(switch(inputdataset,"Raw"=EuStockMarkets,
"Indexed"=wgtEu)[,inputexch],main="EU Markets 1991-1999",
ylab=input$dataset)
The UI (ur.R) code is highly customized to work with the Shiny constructs, so I have turned evaluation off for the code on this slide. This allows user to select which exchanges to include in the plot and to index by the base period if desired.
library(shiny)
shinyUI(fluidPage(
titlePanel("European Stock Markets Data: Code on kwheeles github repository"),
fluidRow(
column(3, wellPanel(
checkboxGroupInput("exch","Exchange Choice:",c("Germany"="DAX","Switzerland"="SMI",
"France"="CAC","United Kingdom"="FTSE"),selected="DAX"),
selectInput("dataset","Raw or Indexed to Base Period", c("Raw", "Indexed"),
selected ="Raw"),
submitButton("Draw New Graph")
)),
column(6,
plotOutput("newSeries")
)
)))
Compliant:
Met my objectives: