I am currently struggling to get a mean value within a data frame.
The df is built like that:
'data.frame': 365 obs. of 5 variables:
$ Day : chr "01" "02" "03" "04" ...
$ Month : Factor w/ 12 levels "01","02","03",..: 1 1 1 1 1 1 1 1 1 1 ...
$ Year : chr "2019" "2019" "2019" "2019" ...
$ XXX : int 2 4 5 5 7 6 6 7 6 6 ...
$ Weekday : Factor w/ 7 levels "Monday","Tuesday",..: 2 3 4 5 6 7 1 2 3 4 ...
I would like to get the mean for the value XXX but only for the first month (my_data$Month == "01"). I tried filtering it with dplyr but could not figure it out..
(For understanding: for each day there is one value in XXX, the df is for one entire year)
Can someone help? Would be much appreciated!