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
We can find duplicated elements with dplyr as follows.
library(dplyr) # Only duplicated elements mtcars %>% filter(duplicated(.[["carb"]]) # All duplicated elements mtcars %>% filter(carb %in% unique(.[["carb"]][duplicated(.[["carb"]])]))