I\'d like to subset a dataframe to include only rows that have unique combinations of three columns. My situation is similar to the one presented in this question, but I\'d
Using dplyr you could do:
dplyr
library(dplyr) # distinct df %>% distinct(v1, v2, v3, .keep_all = T) # non-distinct only df %>% group_by(v1, v2, v3) %>% filter(n() > 1) # exclude any non-distinct df %>% group_by(v1, v2, v3) %>% filter(n() == 1)