Question 1

No R code needed

Question 2

No R code needed

Question 3

No R code needed

Question 4

No R code needed

Question 5

Question 6

library(quantmod)
## Warning: package 'quantmod' was built under R version 4.5.2
## Loading required package: xts
## Warning: package 'xts' was built under R version 4.5.2
## Loading required package: zoo
## Warning: package 'zoo' was built under R version 4.5.2
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Loading required package: TTR
## Warning: package 'TTR' was built under R version 4.5.2
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
getSymbols("MSFT", src="yahoo", from="2025-10-01", to="2026-01-31")
## [1] "MSFT"

Question 7

nrow(MSFT)
## [1] 84

Question 8

library(quantmod)

getSymbols("MSFT", src = "yahoo",
           from = "2025-10-01",
           to   = "2026-01-31")
## [1] "MSFT"
head(Op(MSFT))
##            MSFT.Open
## 2025-10-01    514.80
## 2025-10-02    517.64
## 2025-10-03    517.10
## 2025-10-06    518.61
## 2025-10-07    528.29
## 2025-10-08    523.28
max_open_index <- which.max(Op(MSFT))
max_open_date  <- index(MSFT)[max_open_index]
max_open_price <- Op(MSFT)[max_open_index]

max_open_date
## [1] "2025-10-28"
max_open_price
##            MSFT.Open
## 2025-10-28       550

Question 9

No Rcode Needed