I have tried to download historical data from Yahoo finance in R Studio and to calculate the monthly returns:
Here is the code:
library(scales) # f