This is what i need to do and my coding progress. Can someone tell me if this is correct according to the question?

Show the plot of the historical stock prices and describe statistically your data set and the time series plot of the daily arithmetic and geometric rate of returns.

library(quantmod)

options("getSymbols.warning4.0"=FALSE)

options("getSymbols.yahoo.warning"=FALSE)

getSymbols("TSLA", from ='2018-01-01',

to ="2019-12-31", warning=FALSE,

auto.assign=TRUE)

head(TSLA)

class(TSLA)

chart_Series(TSLA)

TSLA.close=as.vector(TSLA[,2])

plot(TSLA.close, type='l')