DJIA Daily Closing Prices

Developing Data Products - Course Project

Ramana Sonti

Introduction

  1. Shiny with Plotly to create interactive charts
  2. sidebar layout with two input options (slider and dropdown) on the left
  3. main panel on the right displays the chart
  4. input selected from one widget is used to update the other input widget
  5. getSymbols from quantmod package to fetch data from yahoo

Market Data from yahoo

library(data.table)
library(quantmod)
library(zoo)

getSymbols('^DJI',src='yahoo', from='2002-01-01', to='2002-12-31')
[1] "DJI"
trends <- data.frame(Date = index(DJI), coredata(DJI)) %>% select(Date, DJI.Close)
Error in eval(expr, envir, enclos): could not find function "%>%"
head(trends)
Error in head(trends): object 'trends' not found

Navigation and Operation

  1. user input widgets are set from 2001 through 2016.
  2. When user selects a year from any one ofthe input widgets, the event is captured by the server
  3. Server gets the year and uses getSymbols api to fetch the data for that year from finannce.yahoo.com
  4. renderPlotly is used to render the plot
  5. ui displays the plot on the main panel on the right

Plot (screenshot)

Screenshot for DJIA Daily Closing Prices