I'd like to group by two columns, and for the third column I'd like the value to remain same for the first group but changed to 'D5_repeat' for second group.
df <- data.frame(x = c(rep('A',2), rep('B',2)),
y = c(rep('Zebra',4), rep('Lion',4)),
z = c(rep('D5',4), rep('D10',4)))
df %>%
group_by(x,y) %>%
...
Results
#A tibble: 8 × 3
x y z
<chr> <chr> <chr>
1 A Zebra D5
2 A Zebra D5
3 B Zebra D5_repeat
4 B Zebra D5_repeat
5 A Lion D10
6 A Lion D10
7 B Lion D10_repeat
8 B Lion D10_repeat