Assuming your FROM/TO values leave no gaps and never overlap and all your x values are integers and that FROM is sorted -- this should work nicely.
dd<-data.frame(
FROM=c(1,100,200),
TO=c(99,199,399),
GROUP=c(1,2,3)
)
x <- c(50,150,250,20, 350,110)
g <- dd$GROUP[findInterval(x, dd$FROM)]
cbind(x,g)
See ?findInterval
for more information. It's a useful function in situations like this. You might also be interested in something like cut
.