Requirement:
We considered investing in one of any five companies, Ford Motor Company (FORD), Nokia Corporation (NOK), Target Corporation (TGT), Dell Technologies Inc. (DELL), FedEx Corporation (FDX). We collected data from Yahoo Finance and we focused on the Stock Key Performance Metrics, historical stock closing price, and the historical Candlestick information when we wanted to make a quantitative decision.
Based on the P/E Ratio and Market Cap, TGT seems to be more outstanding than the rest. TGT is also better than rest based on the EPS and stocks historical closing price plot. Moreover, the “Candlestick” plots obviously show that the TGT stock is really in an increasing trend comparing to the rest. TGT should be a good option to be invested to make some short term gains.
---
title: 'Lab-1: Dashboard'
author: "Hima Chaudhary & KruTarth Shah"
date: "`r Sys.Date()`"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
social: menu
source_code: embed
---
```{r setup, include = F}
library(flexdashboard)
library(quantmod)
library(plyr)
library(flexdashboard)
library(dygraphs)
library(lubridate)
library(RColorBrewer)
library(DT)
```
# Objective
Requirement:
* Delineate the necessary decision (I will do that below).
* Identify what information will be relevant to decision making.
* Find and collect the data necessary to create your visualization plan.
* Organize and summarize the collected data.
* Design and create the best visualizations to present that information.
* Finally organize the layout of those visualizations in a way that conforms to the theory of dashboarding.
* Write a summary about what decisions you made based on the visualizations that you developed.
# Summary
## Column
### Stock Key Performance Metrics
```{r}
tickers = c('FORD', 'NOK', 'TGT', 'DELL', 'FDX')
yahoo_metrics = yahooQF(c('Price/Sales', 'P/E Ratio',
'Price/EPS Estimate Next Year', 'PEG Ratio',
'Dividend Yield', 'Market Capitalization'))
metrics = getQuote(paste(tickers, sep='', collapse=';'), what=yahoo_metrics)
# Addtickers as the first column and remove the first column which had date stamps
metrics = data.frame(Symbol=tickers, metrics[, 2 : length(metrics)])
# Change the column names.
colnames(metrics) = c('Symbol', 'P-E Ratio',
'Price EPS Estimate Next Year',
'Div Yield', 'Market Cap')
DT::datatable(metrics)
```
### Stock Closing Prices
```{r message = F, warning = F}
invisible(getSymbols(tickers, from = '2019-01-01', to = Sys.Date()))
closing_prices = do.call(merge, lapply(tickers, function(x) Cl(get(x))))
dateperiod = c('2018-01-01', '2019-07-12')
dygraph(closing_prices, main = 'CLOSING PRICE (USD)', group = 'Stock') %>%
dyAxis('y', label = 'Closing Price (USD)') %>%
dyOptions(axisLineWidth = 2.0, colors = RColorBrewer::brewer.pal(5, 'Set1')) %>%
dyHighlight(highlightSeriesBackgroundAlpha = 1.0,
highlightSeriesOpts = list(strokeWidth = 5)) %>%
dyRangeSelector(height = 60)
```
## Column {.sidebar}
Normally, a high P/E ratio means that investors are predicted higher growth in the future. The current average market P/E ratio is roughly 15 to 25 times earnings. Companies that are losing money do not have a P/E ratio. However, a stock with a high P/E ratio is not necessarily a better investment than one with a lower P/E ratio, as a high P/E ratio can indicate that the stock is being overvalued. All the stocks looks good based on the P/E ratio.
A company's earnings per share, or EPS, is found by taking net income (or profits) divided by the shares of common stock outstanding. This measure allows the analyst to understand the amount of money left over for each share of stock issued to the public. So the future earnings estimates are arguably the most important input when attempting to value a firm. Based on this, TGT seems to be a good option.
For the Market Cap, Target seems to be more outstanding than the other stocks.
# Analysis of the stocks
## Candlestick {.tabset data-width=650}
### Ford Motor Company
```{r message = F, warning = F}
invisible(getSymbols('FORD', src = 'yahoo', from = ymd('2019-01-01')))
FORD = FORD[, -5]
colnames(FORD) = c('Open', 'High', 'Low', 'Close', 'Adjusted')
```
```{r message = F, warning = F}
dygraph(FORD, main = 'FORD') %>%
dyAxis('y', label = 'Price (USD') %>%
dyOptions(axisLineWidth = 1.5, colors = RColorBrewer::brewer.pal(5, 'Set1')) %>%
dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 60) %>%
dyCandlestick()
```
### Nokia Corporation
```{r message = F, warning = F}
invisible(getSymbols('NOK', src = 'yahoo', from = ymd('2019-01-01')))
NOK = NOK[, -5]
colnames(NOK) = c('Open', 'High', 'Low', 'Close', 'Adjusted')
```
```{r message = F, warning = F}
dygraph(NOK, main = 'NOK') %>%
dyAxis('y', label = 'Price (USD') %>%
dyOptions(axisLineWidth = 1.5, colors = RColorBrewer::brewer.pal(5, 'Set1')) %>%
dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 60) %>%
dyCandlestick()
```
### Target Corporation
```{r message = F, warning = F}
invisible(getSymbols('TGT', src = 'yahoo', from = ymd('2019-01-01')))
TGT = TGT[, -5]
colnames(TGT) = c('Open', 'High', 'Low', 'Close', 'Adjusted')
```
```{r message = F, warning = F}
dygraph(TGT, main = 'TGT') %>%
dyAxis('y', label = 'Price (USD') %>%
dyOptions(axisLineWidth = 1.5, colors = RColorBrewer::brewer.pal(5, 'Set1')) %>%
dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 60) %>%
dyCandlestick()
```
### Dell Technologies Inc.
```{r message = F, warning = F}
invisible(getSymbols('DELL', src = 'yahoo', from = ymd('2019-01-01')))
DELL = DELL[, -5]
colnames(DELL) = c('Open', 'High', 'Low', 'Close', 'Adjusted')
```
```{r message = F, warning = F}
dygraph(DELL, main = 'DELL') %>%
dyAxis('y', label = 'Price (USD') %>%
dyOptions(axisLineWidth = 1.5, colors = RColorBrewer::brewer.pal(5, 'Set1')) %>%
dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 60) %>%
dyCandlestick()
```
### FedEx Corporation
```{r message = F, warning = F}
invisible(getSymbols('FDX', src = 'yahoo', from = ymd('2019-01-01')))
FDX = FDX[, -5]
colnames(FDX) = c('Open', 'High', 'Low', 'Close', 'Adjusted')
```
```{r message = F, warning = F}
dygraph(FDX, main = 'FDX') %>%
dyAxis('y', label = 'Price (USD') %>%
dyOptions(axisLineWidth = 1.5, colors = RColorBrewer::brewer.pal(5, 'Set1')) %>%
dyHighlight(highlightCircleSize = 4, highlightSeriesOpts = list(strokeWidth = 5),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 60) %>%
dyCandlestick()
```
## Column {.sidebar}
From the analysis, we could infer that Target Corportion is a good option.
From the "Candlestick" plots on the rightdepicts, it's a wise decision to invest in Target Coropration (TGT) as it's an increasing trend relative to others.
Target is a good option to be invested to make some short term gains.
# Conclusion
We considered investing in one of any five companies, Ford Motor Company (FORD), Nokia Corporation (NOK), Target Corporation (TGT), Dell Technologies Inc. (DELL), FedEx Corporation (FDX). We collected data from Yahoo Finance and we focused on the Stock Key Performance Metrics, historical stock closing price, and the historical Candlestick information when we wanted to make a quantitative decision.
Based on the P/E Ratio and Market Cap, TGT seems to be more outstanding than the rest. TGT is also better than rest based on the EPS and stocks historical closing price plot. Moreover, the "Candlestick" plots obviously show that the TGT stock is really in an increasing trend comparing to the rest.
TGT should be a good option to be invested to make some short term gains.