When we use geom_line, we need to specify group=1, because for line graphs, the data points must be grouped. In this case, since all of the points should be connected, the value of the group=1. When more variables are used and multiple lines are drawn, the line grouping is usually done by a variable.
Now, instead of a time series depicting daily prices, we would like to make a plot of prices for every month and also look at the mean closing price for every month.