R: Experiment 1: Inter-arrival delays

lvh<-nrow(To_Chip_RTP)
[1] 107515
lvh<-lvh-1> lvh
[1] 107514
To_Chip_RTP_delay=vector(length=(nrow(To_Chip_RTP)-1))
for (i in 1:lvh) {
To_Chip_RTP_delay[i]<-To_Chip_RTP$Time[i+1]-To_Chip_RTP$Time[i]
}
 
summary(To_Chip_RTP_delay)
   Min.   1st Qu.    Median  Mean   3rd Qu.    Max.
0.01981  0.02000   0.02000  0.02000   0.02001  0.02019

(Note that these times are in seconds.)


Transcript

So, if I want to compute inter-arrival delays, I can assign a variable to say, "give me the number of rows", that's how many data samples there were, subtract one from that. Now apply it and create a vector, here the delay values iterate over them, computing the differences between them. And now that I can say "summary" over that value, I just computed. And sure enough, I now see my min, my max, first and third quartiles, mean and medians.