Last active
January 23, 2017 15:41
-
-
Save edgararuiz-zz/0ad9a1cc3586b99d2ac57186d90e1aa7 to your computer and use it in GitHub Desktop.
This file contains 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
--- | |
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