This is my code
library(ggplot2)
library(quantmod)
library(xts)
library(magrittr)
start <- as.Date("2012-01-01")
end <- as.Date("2019-10-01")
getSymbols(c("AAPL","MSFT", "GOOG","INTC","AMD"), src = "yahoo", from = start, to = end)
stocks <- as.xts(data.frame(AAPL = AAPL[, "AAPL.Close"], MSFT = MSFT[, "MSFT.Close"],
GOOG = GOOG[, "GOOG.Close"],INTC = INTC[, "INTC.Close"],AMD = AMD[, "AMD.Close"]))
head(stocks)
stock_change = stocks %>% log %>% diff
head(stock_change)
What should i do next? I want to plot this using ggplot2 and facet wrap function