Question: Please solve by R script or R studio Please follow the following instructions. The instructions indicate how to download daily stock price of Amazon, Inc.
Please solve by R script or R studio
Please follow the following instructions.
The instructions indicate how to download daily stock price of Amazon, Inc. from 2019-10-01 to 2019-12-31 from Yahoo! Finance.
install.packages("quantmod")
library(quantmod)
getSymbols("AMZN", src = "yahoo", from='2020-03-01', to='2020-04-30')
Then, with the following code, you can take the last column in AMZN, which is AMZN.Adjusted only, and assign the name AMZNAdj to the object.
AMZNAdj <- AMZN$AMZN.Adjusted
Using AMZNAdj, calculate daily log returns and assign the name log_AMZNAdj.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
