codes for grouping a continuous variable to a categorical variable

Thanks Leon. it works. BTW, I found another way that does the same job before seeing yours. ie,
mutate(bmigp=cut(bmi, c(0, 25, 30, 40), labels=c("nwt", "owt", "obese"), LEFT =FALSE)))

Jason