I have a set of data that refers to my Time and my Distance as I run...so I have 2 columns which pertains to Time and Distance. Lets say I ran, 3000m overall. What I want is the average distance I travelled at 30 second intervals...hence I want the average distance I travelled from 0-30 s, 30 -60 s etc....
I did the following code:
tapply(data$Distance,cut(data$Time,pretty(range(data$Time),high.u.bias=0.1)),mean)
but this gave me the average at 200 s intervals...how do I change that?