You could use cut
df$valueBin <- cut(df$value, c(-Inf, 250, 500, 1000, 2000, Inf), labels=c('<=250', '250-500', '500-1,000', '1,000-2,000', '>2,000'))
data
set.seed(24) df <- data.frame(value= sample(0:2500, 100, replace=TRUE))
You could use cut
df$valueBin <- cut(df$value, c(-Inf, 250, 500, 1000, 2000, Inf), labels=c('<=250', '250-500', '500-1,000', '1,000-2,000', '>2,000'))
set.seed(24) df <- data.frame(value= sample(0:2500, 100, replace=TRUE))