In summary, based on the data and findings, I recommend FedEx as a short-term investment option and UPS as a long-term investment option. FedEx - Based on the key findings, FedEx appears to be a promising short-term investment option. The share price has corrected significantly since the pandemic highs, which presents an opportunity for short-term gains. Additionally, the company has a new management team in place, which is focused on cost-cutting efforts. This could result in improved profitability and share price growth in the short term. However, investors should be aware of the potential risks associated with investing in a company that is undergoing significant changes, such as operational disruptions, increased competition, and supply chain issues.
UPS - UPS, on the other hand, appears to be a more stable long-term investment option. The company’s share price has held ground over the given time period, and management has shown positive results. This suggests that the company is well-positioned for long-term growth, although there is a risk of a Teamsters strike in the short term that could disrupt operations. However, UPS’s strong financial position, diversified revenue streams, and focus on sustainability make it a solid choice for long-term investors looking for stability and consistent returns.
Ryder - Ryder’s key findings suggest that the company’s share price growth has been driven by the pandemic, and it has not yet returned to pre-pandemic levels. However, there do not appear to be any immediate risk factors. Investors should be aware of the potential risks associated with investing in a company that is still recovering from the pandemic and may be vulnerable to economic downturns or supply chain disruptions in the future.
XPO - XPO’s key findings suggest that it is a highly volatile investment option, with a number of divestitures that make it difficult to determine the company’s true value. While XPO has shown strong growth potential in the past, it may not be suitable for all investors due to the high level of risk involved.
---
title: "ANLY 512: Lab 1 - Dashboard"
author: "Sonakshi Kuntia"
date: "`r Sys.Date()`"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
social: menu
source: embed
html_document:
df_print: paged
pdf_document: default
---
```{r,echo, include=FALSE}
library(ggplot2)
library(knitr)
library(flexdashboard)
library(quantmod)
library(plyr)
library(dplyr)
library(DT)
library(xts)
library(dygraphs)
library(lubridate)
```
Column {data-width=600}
-------------------------------------------------------
### Last 4 Year Trends
```{r, echo=FALSE, message=FALSE}
ticker = c("FDX", "UPS", "R", "XPO")
invisible(getSymbols(ticker, from="2019-01-01", to="2023-02-28"))
closingPrices=do.call(merge,lapply(ticker,function(x)Cl(get(x))))
datePeriod=c("2019-01-01","2023-02-28")
dygraph(closingPrices, main="Stock Trends for Major Shipping/Transportation Companies", group="Stock") %>% dyCSS(textConnection(".dygraph-title {font-size: 10px;}.dygraph-legend {font-size: 6px;}")) %>%
dyLegend( hideOnMouseOut = TRUE, width = 150)%>%
dyAxis("y",label="Closing Price") %>%
dyOptions(colors=RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightCircleSize = 3.5, highlightSeriesBackgroundAlpha = 1, highlightSeriesOpts = list(strokeWidth=3)) %>%
dyRangeSelector(height=30)
```
Column {.tabset data-width=550}
-----------------------------------------------------
### Table View
```{r , echo=FALSE, message=FALSE}
what_metrics = yahooQF(c("Price/Sales","P/E Ratio", "Price/EPS Estimate Next Year", "PEG Ratio", "Dividend Yield", "Market Capitalization"))
tickers = c("FDX", "UPS", "R", "XPO")
metrics = getQuote(paste(tickers,sep="",collapse=";"), what=what_metrics)
metrics = data.frame(Symbol=tickers,metrics[,2:length(metrics)])
colnames(metrics)=c("Symbol", "Earnings Multiple", "Earnings Multiple (Forward)", "Div Yield", "Market Cap")
#datatable(head(metrics, 20), options = list(initComplete = JS(function(settings, json) {(this.api().table().header()).css({'background-color': 'grey', 'color': '#fff'});})))
DT::datatable(metrics)
```
### FedEx
```{r}
invisible(getSymbols("FDX", src = "yahoo", from='2019-01-01'))
Fdx_x <- FDX
dygraph(Fdx_x[, -5], main = "FedEx") %>%
dyCandlestick() %>%
dyAxis("y", label="Closing Price") %>%
dyOptions(colors= RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightCircleSize = 3.5,
highlightSeriesOpts = list(strokeWidth = 3),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 30)
```
### UPS
```{r}
invisible(getSymbols("UPS", src = "yahoo", from='2019-01-01'))
UPS_x <- UPS
dygraph(UPS_x[, -5], main = "UPS") %>%
dyCandlestick() %>%
dyAxis("y", label="Closing Price") %>%
dyOptions(colors= RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightCircleSize = 3.5,
highlightSeriesOpts = list(strokeWidth = 3),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 30)
```
### Ryder
```{r}
invisible(getSymbols("R", src = "yahoo", from='2019-01-01'))
R_x <- R
dygraph(R_x[, -5], main = "Ryder") %>%
dyCandlestick() %>%
dyAxis("y", label="Closing Price") %>%
dyOptions(colors= RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightCircleSize = 3.5,
highlightSeriesOpts = list(strokeWidth = 3),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 30)
```
### XPO
```{r}
invisible(getSymbols("XPO", src = "yahoo", from='2019-01-01'))
XPO_x <- XPO
dygraph(XPO_x[, -5], main = "XPO") %>%
dyCandlestick() %>%
dyAxis("y", label="Closing Price") %>%
dyOptions(colors= RColorBrewer::brewer.pal(4, "Set1")) %>%
dyHighlight(highlightCircleSize = 3.5,
highlightSeriesOpts = list(strokeWidth = 3),
highlightSeriesBackgroundAlpha = 1) %>%
dyRangeSelector(height = 30)
```
### Summary/Findings
In summary, based on the data and findings, I recommend FedEx as a short-term investment option and UPS as a long-term investment option.
FedEx -
Based on the key findings, FedEx appears to be a promising short-term investment option. The share price has corrected significantly since the pandemic highs, which presents an opportunity for short-term gains. Additionally, the company has a new management team in place, which is focused on cost-cutting efforts. This could result in improved profitability and share price growth in the short term. However, investors should be aware of the potential risks associated with investing in a company that is undergoing significant changes, such as operational disruptions, increased competition, and supply chain issues.
UPS -
UPS, on the other hand, appears to be a more stable long-term investment option. The company's share price has held ground over the given time period, and management has shown positive results. This suggests that the company is well-positioned for long-term growth, although there is a risk of a Teamsters strike in the short term that could disrupt operations. However, UPS's strong financial position, diversified revenue streams, and focus on sustainability make it a solid choice for long-term investors looking for stability and consistent returns.
Ryder -
Ryder's key findings suggest that the company's share price growth has been driven by the pandemic, and it has not yet returned to pre-pandemic levels. However, there do not appear to be any immediate risk factors. Investors should be aware of the potential risks associated with investing in a company that is still recovering from the pandemic and may be vulnerable to economic downturns or supply chain disruptions in the future.
XPO -
XPO's key findings suggest that it is a highly volatile investment option, with a number of divestitures that make it difficult to determine the company's true value. While XPO has shown strong growth potential in the past, it may not be suitable for all investors due to the high level of risk involved.