I have a dataset that looks like this
head(dataset)
Distance Lag time Kurtosis
7.406100 10
144.1700 1
77.31800 1
81.15400 1
4.249167 6
I want to add values to the kurtosis column. To calculate kurtosis I need to group the Distances by Lag time (i.e., all distances for Lag time 1 will give me one value for kurtosis etc.). To get kurtosis I usually use the package "psych" and function describe() Is there a kind of loop I could add to do this?