I tried with age range and it worked. Here\'s the code:
library(data.table) agebreaks <- c(0,10,20,30,40,50,60,70,80) agelabels