Spark-lin
11/27/2016
I want to use plotly to create an interactive chart of three selected Internet Companies’ stock price.
Error in data.frame(Date = index(AAPL), AAPL[, 6], FB[, 6], GOOGL[, 6]) : arguments imply differing number of rows: 2494, 1139
Also I could not proceed the plot_ly to plot the interactive chart. This is due to the fact that Facebook’s initial public offering (IPO) on Friday, May 18, 2012. Therefore, Facebook has different data row with other selected companied.
Thus, I modified my stock pool into : GOOGL(Google), AAPL(Apple), YHOO(Yahoo)
1-Get StockExchange symbol of selected Stocks
2-Create dataframe with selected stock
3-Plot interactive chart with selected stock
## Loading required package: ggplot2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## Loading required package: xts
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
##
## Attaching package: 'xts'
## The following objects are masked from 'package:dplyr':
##
## first, last
## Loading required package: TTR
## Version 0.4-0 included new data defaults. See ?getSymbols.
## As of 0.4-0, 'getSymbols' uses env=parent.frame() and
## auto.assign=TRUE by default.
##
## This behavior will be phased out in 0.5-0 when the call will
## default to use auto.assign=FALSE. getOption("getSymbols.env") and
## getOptions("getSymbols.auto.assign") are now checked for alternate defaults
##
## This message is shown once per session and may be disabled by setting
## options("getSymbols.warning4.0"=FALSE). See ?getSymbols for more details.
## Warning in arrange_impl(.data, dots): '.Random.seed' is not an integer
## vector but of type 'NULL', so ignored