Skip to content

Instantly share code, notes, and snippets.

@edgararuiz-zz
Last active January 23, 2017 15:41
Show Gist options
  • Save edgararuiz-zz/0ad9a1cc3586b99d2ac57186d90e1aa7 to your computer and use it in GitHub Desktop.
Save edgararuiz-zz/0ad9a1cc3586b99d2ac57186d90e1aa7 to your computer and use it in GitHub Desktop.
---
title: "Stock Presentation"
output: ioslides_presentation
params:
stock: GOOG
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE); knitr::opts_chunk$set(warning = FALSE) #-- Hide code and messages
library(magrittr); library(dygraphs) #-- Load needed libraries
stock <- quantmod::getSymbols(params$stock, auto.assign = FALSE) #-- Get stock data
```
## Trade Volume since 2016 - `r params$stock`
```{r}
dygraph(stock[c('2016','2017'), 5]) %>% dyRangeSelector()
```
## Daily Price range for 2017 - `r params$stock`
```{r}
dygraph(stock[c('2017'), c(1:4)]) %>% dyCandlestick()
```
## Last 7 Days - `r params$stock`
```{r}
DT::datatable(tail(stock[,c(1:4)],7))
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment