1 Import stock prices of your choice

## # A tibble: 1,255 × 8
##    symbol date        open  high   low close  volume adjusted
##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>   <dbl>    <dbl>
##  1 COST   2022-01-03  565.  567.  556.  567. 2714100     538.
##  2 COST   2022-01-04  564.  569.  562.  564. 2097500     536.
##  3 COST   2022-01-05  564.  565.  550.  550. 2887500     522.
##  4 COST   2022-01-06  546.  554.  544.  550. 2503100     522.
##  5 COST   2022-01-07  548.  548.  534.  536. 2323900     509.
##  6 COST   2022-01-10  529.  530.  508.  519. 4916800     492.
##  7 COST   2022-01-11  519.  522.  510.  522. 2457300     496.
##  8 COST   2022-01-12  522.  530.  522.  526. 1729500     499.
##  9 COST   2022-01-13  528.  529.  515.  517. 2428100     491.
## 10 COST   2022-01-14  512.  513.  502.  503. 3872500     477.
## # ℹ 1,245 more rows

2 Convert prices to returns by quarterly

## # A tibble: 20 × 3
## # Groups:   symbol [5]
##    symbol date          return
##    <chr>  <date>         <dbl>
##  1 COST   2022-03-31  0.0177  
##  2 COST   2022-06-30 -0.166   
##  3 COST   2022-09-30 -0.0129  
##  4 COST   2022-12-30 -0.0316  
##  5 DIS    2022-03-31 -0.125   
##  6 DIS    2022-06-30 -0.312   
##  7 DIS    2022-09-30 -0.000741
##  8 DIS    2022-12-30 -0.0790  
##  9 NKE    2022-03-31 -0.181   
## 10 NKE    2022-06-30 -0.239   
## 11 NKE    2022-09-30 -0.184   
## 12 NKE    2022-12-30  0.412   
## 13 SBUX   2022-03-31 -0.216   
## 14 SBUX   2022-06-30 -0.154   
## 15 SBUX   2022-09-30  0.109   
## 16 SBUX   2022-12-30  0.184   
## 17 F      2022-03-31 -0.219   
## 18 F      2022-06-30 -0.337   
## 19 F      2022-09-30  0.0163  
## 20 F      2022-12-30  0.0492

3 Make plot

4 Interpret the plot

The plot shows that the five stocks had different quarterly returns throughout 2022. Most of the stocks had negative returns during the first half of the year. Returns generally improved during the second half. NKE had the largest increase in the final quarter, while SBUX also finished the year with a strong positive return. Overall, the graph shows that stock performance varied significantly throughout the year.

5 Change the global chunck options

Hide the code, messages, and warnings