When I use distinct on a grouped data.frame and explicitly put the group columns in the distinct, then I get duplicated columns:
df <- data.frame( a = c(1,2,3), b=c(4,5,6), c=c(7,8,9))
df %>% group_by(a) %>% distinct(a,b)
# creates a data.frame with two 'a' columns
Since putting 'a' in the distinct is not necessary as the group_by already makes sure that every value in 'a' is unique, this problem is easily fixed on the user side.
When I use distinct on a grouped data.frame and explicitly put the group columns in the distinct, then I get duplicated columns:
Since putting 'a' in the distinct is not necessary as the group_by already makes sure that every value in 'a' is unique, this problem is easily fixed on the user side.