R Markdown

Apple_Stockprice_History <- read_csv("aapl_us_d.CSV")
## Rows: 10080 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl  (5): Open, High, Low, Close, Volume
## date (1): Date
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Apple_Stockprice_History
## # A tibble: 10,080 × 6
##    Date        Open  High    Low  Close     Volume
##    <date>     <dbl> <dbl>  <dbl>  <dbl>      <dbl>
##  1 1984-09-07 0.101 0.102 0.0995 0.101   97676042.
##  2 1984-09-10 0.101 0.101 0.0983 0.100   75812543.
##  3 1984-09-11 0.101 0.104 0.101  0.102  178770477.
##  4 1984-09-12 0.102 0.103 0.0989 0.0989 156171258.
##  5 1984-09-13 0.104 0.105 0.104  0.104  243230959.
##  6 1984-09-14 0.105 0.108 0.105  0.106  289611904.
##  7 1984-09-17 0.109 0.110 0.109  0.109  226123798.
##  8 1984-09-18 0.109 0.110 0.105  0.105  114152470.
##  9 1984-09-19 0.105 0.106 0.103  0.103  124690011.
## 10 1984-09-20 0.103 0.104 0.103  0.103   77625794.
## # ℹ 10,070 more rows

Summary

summary(Apple_Stockprice_History)
##       Date                 Open                High          
##  Min.   :1984-09-07   Min.   :  0.05541   Min.   :  0.05602  
##  1st Qu.:1994-08-24   1st Qu.:  0.29294   1st Qu.:  0.29863  
##  Median :2004-08-28   Median :  0.88405   Median :  0.90743  
##  Mean   :2004-08-29   Mean   : 24.21265   Mean   : 24.47418  
##  3rd Qu.:2014-09-02   3rd Qu.: 21.63550   3rd Qu.: 21.86978  
##  Max.   :2024-09-06   Max.   :236.48000   Max.   :237.23000  
##       Low               Close              Volume         
##  Min.   :  0.0548   Min.   :  0.0548   Min.   :2.812e+06  
##  1st Qu.:  0.2860   1st Qu.:  0.2923   1st Qu.:1.386e+08  
##  Median :  0.8644   Median :  0.8830   Median :2.577e+08  
##  Mean   : 23.9627   Mean   : 24.2286   Mean   :3.902e+08  
##  3rd Qu.: 21.4269   3rd Qu.: 21.6490   3rd Qu.:4.927e+08  
##  Max.   :233.0900   Max.   :234.8200   Max.   :8.707e+09

#Calculate mean, median, and standard deviation for mpg

Mean_Stock Price

mean_Stock_Price <- mean(Apple_Stockprice_History$Close)
mean_Stock_Price 
## [1] 24.22859

Median_Stock Price

median_Stock_Price <- median(Apple_Stockprice_History$Close)
median_Stock_Price 
## [1] 0.883006

SD_Stock Price

sd_Stock_Price <- sd(Apple_Stockprice_History$Close)
sd_Stock_Price 
## [1] 48.51398

Min_Stock Price

min_Stock_Price <- min(Apple_Stockprice_History$Close, na.rm = TRUE)
min_Stock_Price
## [1] 0.0548028

Max_Stock Price

max_Stock_Price <- max(Apple_Stockprice_History$Close, na.rm = TRUE)
max_Stock_Price
## [1] 234.82

Price line Plot

ggplot(Apple_Stockprice_History, aes(x = Date, y = Close)) +
  geom_line(color = "blue") +
  labs(title = "Apple Stock Closing Price History", x = "Date", y = "Close Price") +
  theme_minimal()