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
Another solution is to use janitor package:
janitor
mtcars %>% get_dupes(wt)