Earliest Date for each id in R

前端 未结 4 1729
余生分开走
余生分开走 2020-12-31 18:54

I have a dataset where each individual (id) has an e_date, and since each individual could have more than one e_date, I\'m trying to get the earli

4条回答
  •  情书的邮戳
    2020-12-31 19:25

    Another answer that uses dplyr's filter command:

    dta %>% 
      group_by(id) %>%
      filter(date == min(date))
    

提交回复
热议问题