Tidyverse extract elemens from character conditions

Does this work:

library(dplyr)
df %>% group_by(var1) %>% filter(length(unique(var2))>1) %>% distinct(var1)
# A tibble: 1 x 1
# Groups:   var1 [1]
  var1 
  <chr>
1 b    
 

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top