In this section displays analysis data from two Boeing and Airbus stocks, namely, price ratio (P-E Ratio), Price EPS Estimate, and Dividend Yield.
P-E Ratio from the analysis table shows that Boeing shares are cheaper than Airbush shares, and prices tend to decline.
While Airbus’s Dividend Yield is larger than Boeing’s, its stock price is also expected to be stable.
---
title: "bpe 313: Boeing Stock Visualization"
subtitle: "Dashboard Laboratory"
author: "bambangpe"
date: "March 13, 2019"
output:
flexdashboard::flex_dashboard:
orientation: rows
social: menu
source_code: embed
---
```{r setup, include=FALSE, message=FALSE}
# list of libraries we are using in this dashboard
library(flexdashboard)
library(quantmod)
library(plyr)
library(dygraphs)
library(lubridate)
library(RColorBrewer)
library(DT)
```
# Intro text {.sidebar}
## **Trend Analysis**
* This dashboard only displays the movement of shares of 2 Boeing (BA) and Airbus (EADSY) airlines, observing the movements of Boeing's shares after the tragedy of the fall of a Boeing 737 Max8 aircraft. Trends are taken in a 1 year period
* Boeing shares began to decline after the tragedy of the crash on Sunday on March 10, 2019
* While Airbus shares remain flat not affected.
# Stock Dashboard
Column {data-width=550}
-----------------------------------------------------------------------
### Stock Closing Prices - 1 year trend
```{r,echo=FALSE, message = FALSE}
ticker <- c("BA","EADSY")
invisible(getSymbols(ticker, from="2018-03-13", to="2019-03-13"))
closing_price <- do.call(merge, lapply(ticker, function(x) Cl(get(x))))
dateperiod<-c("2018-03-13","2019-03-13")
dygraph(closing_price, main="Stock Closing Price (USD)", group="Stock") %>%
dyAxis("y", label="Closing Price (USD)") %>%
dyOptions(axisLineWidth = 2.0, colors = RColorBrewer::brewer.pal(6, "Set1")) %>%
dyHighlight(highlightSeriesBackgroundAlpha = 1.0,
highlightSeriesOpts = list(strokeWidth = 2)) %>%
dyRangeSelector(height = 60)
```
#Fundamental Analysis
* In this section displays analysis data from two Boeing and Airbus stocks, namely, price ratio (P-E Ratio), Price EPS Estimate, and Dividend Yield.
* P-E Ratio from the analysis table shows that Boeing shares are cheaper than Airbush shares, and prices tend to decline.
* While Airbus's Dividend Yield is larger than Boeing's, its stock price is also expected to be stable.
```{r}
what_metrics <- yahooQF(c("Price/Sales",
"P/E Ratio",
"Price/EPS Estimate Next Year",
"PEG Ratio",
"Dividend Yield",
"Market Capitalization"))
tickers <- c("BA","EADSY")
# Not all the metrics are returned by Yahoo.
metrics <- getQuote(paste(tickers, sep="", collapse=";"), what=what_metrics)
#Add tickers as the first column and remove the first column which had date stamps
metrics <- data.frame(Symbol=tickers, metrics[,2:length(metrics)])
#Change colnames
colnames(metrics) <- c("Symbol", "P-E Ratio", "Price EPS Estimate Next Year", "Div Yield", "Market Cap")
#Persist this to the csv file
#write.csv(metrics, "FinancialMetrics.csv", row.names=FALSE)
DT::datatable(metrics)
```
# Candlestick Charts
Column {.tabset}
-----------------------------------------------------------------------
### Boeing
```{r message=FALSE, warning=FALSE}
startdate <- ymd("2018-11-13")
invisible(getSymbols("BA", src = "yahoo", from=startdate))
NBA <- BA[,-5]
colnames(NBA) <- c("Open","High","Low","Close","Adjusted")
```
```{r message=FALSE, warning=FALSE}
dygraph(BA, main = "Boeing - Past 5 Months Trend") %>%
dyAxis("y", label="Price (USD)") %>%
dyOptions(axisLineWidth = 2, colors = RColorBrewer::brewer.pal(5, "Set1")) %>%
dyCandlestick()
```
### Airbus
```{r message=FALSE, warning=FALSE}
startdate <- ymd("2018-11-13")
invisible(getSymbols("EADSY", src = "yahoo", from=startdate))
NEADSY <- EADSY[,-5]
colnames(NEADSY) <- c("Open","High","Low","Close","Adjusted")
```
```{r message=FALSE, warning=FALSE}
dygraph(EADSY, main = "Airbus - Past 5 Months Trend") %>%
dyAxis("y", label="Price (USD)")%>%
dyOptions(axisLineWidth = 1, colors = RColorBrewer::brewer.pal(5, "Set1")) %>%
dyCandlestick()
```