I have a large dataset, over 1.5 million rows, from 600k unique subjects, so a number of subjects have multiple rows. I am trying to find the cases where the one of the subj
DOBError <- function(data){ count <- unlist(lapply(split(test, test$ID), function(x)length(unique(x$DOB)))) return(names(count)[count > 1]) } DOBError(data) [1] "2"