Importing the Data & Libraries
In this analysis, we are analyzing the stock trends on the electric car company, Tesla (stock symbol: TSLA) using data from Yahoo Finance. I utilized the “quantmod” package for financial modeling which I found through Google: https://cran.r-project.org/web/packages/quantmod/index.html. Additionally, I am using ggplot2 for data visualization. Setting up the environment involves installing and loading necessary packages, including setting a CRAN mirror with the official repository URL.
options(repos = c(CRAN = “https://cloud.r-project.org”))
install.packages(“quantmod”)
install.packages(“ggplot2”)
library(quantmod)
library(ggplot2)