Column

Adj Close Price

      SFIX             SQ             SPOT            SHOP      
 Min.   :16.72   Min.   :50.72   Min.   :106.8   Min.   :119.1  
 1st Qu.:24.40   1st Qu.:66.95   1st Qu.:134.8   1st Qu.:144.4  
 Median :26.99   Median :72.53   Median :141.9   Median :162.4  
 Mean   :28.31   Mean   :72.62   Mean   :149.3   Mean   :185.4  
 3rd Qu.:31.04   3rd Qu.:75.63   3rd Qu.:171.1   3rd Qu.:206.0  
 Max.   :51.19   Max.   :99.01   Max.   :196.3   Max.   :328.0  

Volume

Open Price

Row

Summary

The Adj close price data from 2018 July to 2019July shows that the value of SHOP(Shoplify) stock has drastically increased since 2019 January. It even surprass the value of SPOT(Spotify), which had higher price amoung 4 of the companies.Thus, I would suggest to purchase SHOP stock at price around $250 in short term.
SFIX, SQ and SPOT seem to have similar pattern of stock price change in the past year. Another intereting finding from the Volume tab is that SFIX seems to have higer volume at the begging of each quarter. and the volume of trading.

Company Info

              Trade Time   Last    Change   % Change   Open     High
SFIX 2019-07-09 16:00:01  29.35 -1.229999 -4.0222354  30.33  30.5545
SQ   2019-07-09 16:03:03  77.96  4.529999  6.1691390  74.03  78.3900
SPOT 2019-07-09 16:00:55 147.24  2.950012  2.0445023 144.39 147.3000
SHOP 2019-07-09 16:02:04 321.98  0.980011  0.3052994 322.41 324.4300
        Low   Volume
SFIX  29.30  2476355
SQ    73.96 20378787
SPOT 144.39  1281799
SHOP 319.50  1734225
---
title: "ANLY512_Lab1_Yayun Cheng"
output:
  flexdashboard::flex_dashboard:
    source: embed
    vertical_layout: fill
  
---

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

Column {.tabset}
-----------------------------------------------------------------------
### Adj Close Price 

```{r , fig.width=1, fig.height=1}
require('pdfetch')
library(dplyr)

#Adjclose 
SHOP.adjc.pdfetch <- pdfetch_YAHOO(identifiers = 'SHOP', fields = 'adjclose',from = '2018-7-4')
SPOT.adjc.pdfetch <- pdfetch_YAHOO(identifiers = 'SPOT', fields = 'adjclose',from = '2018-7-4')
SQ.adjc.pdfetch <- pdfetch_YAHOO(identifiers = 'SQ', fields = 'adjclose',from = '2018-7-4')
SFIX.adjc.pdfetch <- pdfetch_YAHOO(identifiers = 'SFIX', fields = 'adjclose',from = '2018-7-4')

adjclose <- data.frame(SFIX.adjc.pdfetch,SQ.adjc.pdfetch,SPOT.adjc.pdfetch, SHOP.adjc.pdfetch)

library(dygraphs)

adjclose_graph<-dygraph(adjclose, main="Adj Close Price 2018 July to 2019 July", ylab="Price" )
adjclose_graph 
summary(adjclose)

```

###Volume

```{r}
require('pdfetch')
#Volume
SHOP.vol <- pdfetch_YAHOO(identifiers = 'SHOP', fields = 'volume',from = '2018-7-4')
SPOT.vol <- pdfetch_YAHOO(identifiers = 'SPOT', fields = 'volume',from = '2018-7-4')
SQ.vol <- pdfetch_YAHOO(identifiers = 'SQ', fields = 'volume',from = '2018-7-4')
SFIX.vol <- pdfetch_YAHOO(identifiers = 'SFIX', fields = 'volume',from = '2018-7-4')

volume <- data.frame(SFIX.vol,SQ.vol,SPOT.vol, SHOP.vol)


library(dygraphs)
volume_graph<-dygraph(volume, main="Volume (2018 July~ 2019 July)", ylab="volume" )

volume_graph

```

### Open Price

```{r}
library(tidyquant)
library(lubridate)
SFIX <- tq_get("SFIX", get = "stock.prices", from = "2018-01-01", to = "2019-07-01")
SQ <- tq_get("SQ", get = "stock.prices", from = "2018-01-01", to = "2019-07-01")
SPOT <- tq_get("SPOT", get = "stock.prices", from = "2018-01-01", to = "2019-07-01")
SHOP <- tq_get("SHOP", get = "stock.prices", from = "2018-01-01", to = "2019-07-01")
SSSS<- c("SFIX", "SQ", "SPOT", "SHOP") %>%
    tq_get(get = "stock.prices", from = "2018-01-01", to = "2019-07-01")

library(ggplot2)
boxplot(formula=SSSS$open~SSSS$symbol,
        data=SSSS,
        xlab="Company",
        ylab="Open Price",
        col.lab= "gray33",
        col.axis="gray50",
        fg="gray50",
        col=c("khaki1","darkmagenta","darkgreen","deepskyblue4"),
       legend=c("SFIX", "SQ", "SPOT", "SHOP"))

```


Row
-----------------------------------------------------------------------
### Summary

The Adj close price data from 2018 July to 2019July shows that the value of SHOP(Shoplify) stock has drastically  increased since 2019 January. It even surprass the value of SPOT(Spotify), which had higher price amoung 4 of the companies.Thus, I would suggest to purchase SHOP stock at price around $250 in short term.   
SFIX, SQ and SPOT seem to have similar pattern of stock price change in the past year.
Another intereting finding from the Volume tab is that SFIX seems to have higer volume at the begging of each quarter. and the volume of trading.

```{r, fig.width=0.5, fig.height=1}

```

### Company Info 

```{r,fig.width=2, fig.height=2}

library(quantmod)
getQuote("SFIX;SQ;SPOT;SHOP")

```