Questions R how to obtain the mean of previous values depending on a second column with data in long format byMRAugust 16, 2022