split() and unsplit()

x <- c(0, 0.2, 0.25, 0.4, 0.66, 1)

f <- findInterval(x, c(-Inf, 0.25, 0.5, 0.75, Inf))

split(x, f)
## $`1`
## [1] 0.0 0.2
## 
## $`2`
## [1] 0.25 0.40
## 
## $`3`
## [1] 0.66
## 
## $`4`
## [1] 1
  • i.e. x[1:2] pairs with f[1:2], x[3:4] pairs with f[3:4]