Skip to content
Prev 173825 / 398503 Next

Testing for Inequality à la "select case"

Using cut/split seems like gross overkill here.  Among other things,
you don't need to generate labels for all the different ranges.

   which(x<=range)[1]

seems straightforward enough to me, but you could also use the
built-in function findInterval.

              -s