I have a data frame with some missing group information. I want to use the value to match to where the identical value is found to assign the group.
df <- data.frame(group = c(NA, 'group1', 'group2'),
value = c(0.7, 0.7, 0.3))
How can I see where the value of the NA group matches to another group, and set that NA value equal to that group? Here, the NA should be 'group1'.