Find duplicated elements with dplyr

后端 未结 5 1341
花落未央
花落未央 2020-12-04 11:06

I tried using the code presented here to find ALL duplicated elements with dplyr like this:

library(dplyr)

mtcars %>%
mutate(cyl.dup = cyl[duplicated(cyl         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 11:39

    Another solution is to use janitor package:

    mtcars %>% get_dupes(wt)
    

提交回复
热议问题