recode
require(car)
eg<-1:10
VAR<-recode(eg,"c(0,5,8,10)=20;c(1,4)=30;c(3,6,9)=90;c(2,7)=50")
VAR
[1] 30 50 90 30 20 90 50 20 90 20