Developing Data Products Final Assignment

Keith Wheeles
02/09/2016

Objectives: What I set out to do

Of course, to meet assignment requirements first! Assignment instructions were loose, so I set out to create a project that:

  • Used domain knowledge I am familiar with (economics)
  • Exercised Shiny features I think could be useful to me like graphs
  • Did not overtax the free shinyioapps framework

My page: https://kwheeles.shinyapps.io/DataProd/

Server Side Code: Adapted

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")

Resulting Plot Example

plot(switch(inputdataset,"Raw"=EuStockMarkets,
                                "Indexed"=wgtEu)[,inputexch],main="EU Markets 1991-1999",
                                ylab=input$dataset)

plot of chunk unnamed-chunk-2

Client Side Code: Shown but not to run

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")

                )
)))

Summary: How did we do

Compliant:

  • Five slides (excluding cover slide)
  • On Rpubs
  • Using RStudio Presenter

Met my objectives:

  • Used domain knowledge I am familiar with (economics)
  • Exercised Shiny features I think could be useful to me like graphs
  • Did not overtax the free shinyioapps framework