Here's the answer in plain old R.
#make up some data df <- data.frame(rt = rnorm(60), id = rep(letters[1:3], rep(20)) )
You will notice that any quantiles can be used for the quantile command used. Used by default for quintiles, but if you want to decile use
quantile(x, seq(0, 1, 0.1))
in the above function.
The answer above is a little fragile. This requires an equal amount of RT / id, and I did not tell you how to get to magic number 4. But it will also work very quickly on a large data set. If you want a more reliable solution in the R database.
library('Hmisc') df <- df[order(df$id),] df$bin <- unlist(lapply( unique(df$id), function(x) cut2(df$rt[df$id==x], g = 5) ))
This is much more reliable than the first solution, but it is not so fast. For small datasets you will not notice.
source share