say have tbl this, grouped var1:
var1 var2 2 3 0 b 0 b 2 b 1 c 0 c 0 c 0 i wondering if there's way rid of groups zeros in var2, example in data set group c should removed, this:
var1 var2 2 3 0 b 0 b 2 b 1 is there easy way using dplyr? answer using functions in dplyr , tidyr, connected %>%.
try like:
library('dplyr') tbl %>% group_by(var1) %>% filter(!all(var2 == 0))
Comments
Post a Comment