The overview

##Column

Chart of all securities

Column

P/E Ration of four companies


The Facebook and Google securities P/E Ratio is smallest. These securities price is camparatitive lower that the return, The price of securities is not overestimated comparative to other securities. Hence, we intend to choose one of Facebook and Google securities.

Specific trend line 1

Column

Column 1

Chart FB

[1] "FB"


-The FaceBook security is rising andthe increase in higher than GOOGLE.

We choose FaceBook security.

Column 2

Chart GOOG

[1] "GOOG"


-The GOOGLE security is rising but the increase in lower tha FaceBook, even it also has the low P/E Ratio.

-The line is more volitile than FaceBook

We do not choose it.

Specific trend line 2

Column 1

Chart ORCL

[1] "ORCL"


-The ORACLE is rising in the most time but beacause of the high P/R Ratio.

we do not choose it

Column2

Chart AMZN

[1] "AMZN"


-The AMAZON security is volitile compared to othe three securities and also has the high P/E Ratio

so we do not choose it.

---
title: "Security information Data-driven-thinking"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    storyboard: true
    social: menu
    source: embed
    
---


# Intro text{.sidebar}


This dashboard is provided four different technology companies securities information in 90 trade days. These four companies are all companies whose stock prices have risen in the short term, so our investment has reason to choose one from these four companies. 

In this dashboard, we caompare the P/E ratio and the stock time trend line to achieve the result. The P/E ratio helps investors determine the market value of the stock compared to the company's earnings. In short, the P/E ratio shows the price the market is willing to pay for the stock based on its past or future earnings. A high P/E ratio may mean that the price of a stock may be overvalued relative to earnings and may be overvalued. Conversely, a low P/E ratio may indicate that the current stock price is lower relative to the return.

In the next page, the dashboard show the time line of the stock history. If we only intend to make an investment in securities/commodities to make some short term gains, the blue part of the line is the focus area to analysis.

All data is from Tahoo Finance and I choose the near 90 days price to analysis


```{r setup, include=FALSE}
library(flexdashboard)
library(ggplot2)
```


# The overview

##Column {data-width=650}
-----------------------------------------------------------------------

### Chart of all securities

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

tickers <- c("FB", "GOOG", "ORCL", "AMZN")
metrics <- getQuote(paste(tickers, sep="", collapse=";"), what=what_metrics)
metrics <- data.frame(Symbol=tickers, metrics[,2:length(metrics)]) 
colnames(metrics) <- c("Symbol", "P-E Ratio", "Price EPS Estimate Next Year", "Div Yield", "Market Cap")
DT::datatable(metrics)
```


## Column


### P/E Ration of four companies

```{r}
g<-ggplot(metrics,aes(metrics$Symbol,metrics$`P-E Ratio`,fill =factor(metrics$Symbol)))+geom_col()
g
```


*** 


The Facebook and Google securities P/E Ratio is smallest.
These securities price is camparatitive lower that the return,
The price of securities is not overestimated comparative to other securities.
Hence, we intend to choose one of Facebook and Google securities.


# Specific trend line 1

Column {data-width=50}
-----------------------------------------------------------------------

## Column 1

### Chart FB

```{r}
getSymbols("FB")
FB<-tail(FB,90)
close <- (Cl(FB))
time <- index(close)
time<-as.Date(time)
value <- as.vector(close)
yrng <- range(value)
xrng <- range(time)
data <- data.frame(start=as.Date(c('2018-10-29','2019-1-1')),end=as.Date(c('2018-12-31','2019-3-11')),core=c('2017','2018'))
p <- ggplot(data.frame(time,value),aes(time,value))
p + geom_rect(aes(NULL,NULL,xmin = start, xmax = end, fill = core),ymin = yrng[1],ymax=yrng[2],data = data) +geom_line()  + labs(title = "FB Bar Chart", y = "Closing Price", x = "time")


```

***

-The FaceBook security is rising andthe increase in higher than GOOGLE.

We choose FaceBook security.

## Column 2

### Chart GOOG

```{r}
getSymbols("GOOG")
GOOG<-tail(GOOG,90)
close <- (Cl(GOOG))
time <- index(close)
time<-as.Date(time)
value <- as.vector(close)
yrng <- range(value)
xrng <- range(time)
data <- data.frame(start=as.Date(c('2018-10-29','2019-1-1')),end=as.Date(c('2018-12-31','2019-3-11')),core=c('2017','2018'))
p <- ggplot(data.frame(time,value),aes(time,value))
p + geom_rect(aes(NULL,NULL,xmin = start, xmax = end, fill = core),ymin = yrng[1],ymax=yrng[2],data = data) +geom_line()  + labs(title = "GOOG Bar Chart", y = "Closing Price", x = "time")
```



***

-The GOOGLE security is rising but the  increase in lower tha FaceBook, even it also has the low P/E Ratio.

-The line is more volitile than FaceBook 

We do not choose it.


# Specific trend line 2


## Column 1


### Chart ORCL

```{r}
getSymbols("ORCL")
ORCL<-tail(ORCL,90)
close <- (Cl(ORCL))
time <- index(close)
time<-as.Date(time)
value <- as.vector(close)
yrng <- range(value)
xrng <- range(time)
data <- data.frame(start=as.Date(c('2018-10-29','2019-1-1')),end=as.Date(c('2018-12-31','2019-3-11')),core=c('2017','2018'))
p <- ggplot(data.frame(time,value),aes(time,value))
p + geom_rect(aes(NULL,NULL,xmin = start, xmax = end, fill = core),ymin = yrng[1],ymax=yrng[2],data = data) +geom_line()  + labs(title = "ORCL Bar Chart", y = "Closing Price", x = "time")

```


***

-The ORACLE is rising in the most time but beacause of the high P/R Ratio.

we do not choose it


## Column2

### Chart AMZN

```{r}
getSymbols("AMZN")
AMZN<-tail(AMZN,90)
close <- (Cl(AMZN))
time <- index(close)
time<-as.Date(time)
value <- as.vector(close)
yrng <- range(value)
xrng <- range(time)
data <- data.frame(start=as.Date(c('2018-10-29','2019-1-1')),end=as.Date(c('2018-12-31','2019-3-11')),core=c('2017','2018'))
p <- ggplot(data.frame(time,value),aes(time,value))
p + geom_rect(aes(NULL,NULL,xmin = start, xmax = end, fill = core),ymin = yrng[1],ymax=yrng[2],data = data) +geom_line()  + labs(title = "AMZN Bar Chart", y = "Closing Price", x = "time")

```

***

-The AMAZON security is volitile compared to othe three securities and also has the high P/E Ratio

so we do not choose it.