train$Age <- round(train$Age, digits = 0) train$AgeCount <- sapply(train$Age, function(x) length(which(train$Age == x)))