how do I check if unique groups only have identical observations? I'd like to have an additional column (dummy) with a 1 when there are only identical values per group (here group1). Eg
sample <- data.frame(name = c("group1", "group1", "group1", "group2","group2", "group2"),
value = c(23,23,23,44,33,44))
sample <- sample %>% group_by(name) %>% mutate(identical_valuesOnly = if_else(name = value,1,0)????