---
title: "Major Korean Entertainment Companies Stock Performance"
output:
flexdashboard::flex_dashboard:
orientation: columns
source_code: embed
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
library(quantmod)
library(xts)
library(zoo)
start <- as.POSIXct("2015-01-01")
end <- as.POSIXct("2018-10-01")
getSymbols(c("041510.KQ","122870.KQ", "035900.KQ", "182360.KQ"), src = "yahoo", from = start, to = end)
stocks <- as.xts(data.frame(SM = `041510.KQ`$"041510.KQ.Close", YG = `122870.KQ`$"122870.KQ.Close", JYP = `035900.KQ`$"035900.KQ.Close", CUBE = `182360.KQ`$"182360.KQ.Close"))
head(stocks)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
plot(as.zoo(stocks),screens = 1,lty = c(1,3,5),col = c("red","blue","green") ,xlab = "Date",ylab = "Price"); title(main = "Stock Closing Price Trend Overview")
legend("top",c("SM","YG","JYP","CUBE"),lty = c(1,3,5),col = c("red","blue","green"),cex = 0.5)
```
```{r}
```
Column {data-width=350}
-----------------------------------------------------------------------
### Chart B
```{r}
SM <- to.monthly(`041510.KQ`)
candleChart(SM, up.col="blue",dn.col="red",theme = "white")
```
### Chart C
```{r}
YG <- to.monthly(`122870.KQ`)
candleChart(YG,up.col="Blue",dn.col="red",theme = "white")
```