Within ID, check for matches/differences

前端 未结 4 742
自闭症患者
自闭症患者 2021-01-12 00:11

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

4条回答
  •  长发绾君心
    2021-01-12 00:33

    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"
    

提交回复
热议问题