Objective

Row

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.

Row

My plan:

As an active investor in the stock market, I love to purchase the stock of leading business in each industry. Therefore, I piceck 3 corportations from the Fintech industry which include Alibaba Group Holding Ltd (BABA), U.S. Bank (USB), and PayPal (PYPL). The data is directly collected from Yahoo Finance and I look into the Stock Key Performance Metrics to make my investment decision.

Summary

Row

Stock Key Performance Metrics

Row

Stock Closing Prices

[1] "BABA" "USB"  "PYPL"

Conclusion

Row

Conclusion:

The result is very powerful. BABA and PYPL has dramaticall increased from 2015 to 2021. However, USB’s stock is almost flat over these years. Also, since the growing of finance security and digital currency, PYPL has even higher growth in the last 2 years.

Based on the P/E Ratio and Market Cap, PYPL and BABA seems to be more outstanding as well. Therefore, PYPL is my number one investment option for 2021.

---
title: "ANLY 512 Lab 1 - Dashboard Theory"
author: "Ruohai Wang"
date: "09/12/2021"

output: 
  flexdashboard::flex_dashboard:
    orientation: column
    vertical_layout: fill
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
#install.packages("quantmod")
library(quantmod)
library(plyr)
#install.packages("DT")
library(DT)
#install.packages("dygraphs")
library(dygraphs)
#install.packages("tidyquant")
library(ggplot2)
library(xts)
library(dygraphs)
library(tidyquant)
library(dplyr)
#install.packages("pdfetch")
#install.packages("dygraphs")
library(pdfetch)
library(xts)
identifiers <- c("BABA", "USB", "PYPL")
```


Objective
================================

Row {}
-------------------------
### 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.


Row {}
-------------------------
### My plan:

As an active investor in the stock market, I love to purchase the stock of leading business in each industry. Therefore, I piceck 3 corportations from the Fintech industry which include Alibaba Group Holding Ltd (BABA),  U.S. Bank (USB), and PayPal (PYPL). The data is directly collected from Yahoo Finance and I look into the Stock Key Performance Metrics to make my investment decision.



Summary
================================

Row {}
-------------------------
### Stock Key Performance Metrics 


```{r}
what_metrics <- yahooQF(c("Price/Sales", 
                          "P/E Ratio",
                          "Price/EPS Estimate Next Year",
                          "PEG Ratio",
                          "Dividend Yield", 
                          "Market Capitalization"))

tickers <- c("BABA", "USB", "PYPL")
# 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")

#Export financial stock key performance metrics to a csv file
write.csv(metrics, "FinancialMetrics.csv", row.names=FALSE)
DT::datatable(metrics)
```

Row {}
-------------------------
### Stock Closing Prices

```{r}
getSymbols(tickers, from="2015-01-01", to="2021-05-01")
ClosingPrices <- do.call(merge, lapply(tickers, function(x) Cl(get(x))))
dateperiod<-c("2015-01-01", "2019-05-01")
dygraph(ClosingPrices, main="Closing Price in Dollars", group="Stock") %>%
  dyAxis("y", label="Closing Price(USD)") %>%
  dyOptions(axisLineWidth = 1.5,  colors = RColorBrewer::brewer.pal(5, "Set1")) %>%
  dyHighlight(highlightSeriesBackgroundAlpha = 1.0, highlightSeriesOpts = list(strokeWidth = 3)) %>%
  dyRangeSelector(height = 50)
```


Conclusion
================================

Row {}
-------------------------
### Conclusion:

The result is very powerful. BABA and PYPL has dramaticall increased from 2015 to 2021. However, USB's stock is almost flat over these years. Also, since the growing of finance security and digital currency, PYPL has even higher growth in the last 2 years. 

Based on the P/E Ratio and Market Cap, PYPL and BABA seems to be more outstanding as well. Therefore, PYPL is my number one investment option for 2021.