Skip to content
Prev 327266 / 398502 Next

How to split two levels several times?

Hello,

It's better if you keep this on the list, the odds of getting more and 
better answers are greater.

As for your new question, try the following.


lens <- rle(as.character(XXX$electrode))$lengths
m <- length(lens) %/% 2
idx <- rep(1:m, sapply(1:m, function(.m) sum(lens[(2*.m - 1):(2*.m)])))
split(XXX, idx)


Hope this helps,

Rui Barradas

Em 23-07-2013 11:41, dennis1991 at gmx.net escreveu: