Sorry, I know my question should have been answered somewhere, just I don't know how to find that. It would be great if someone could either redirect me to a post where the answer is, or write an answer here.
I have 2 data sets. First:
image_index <- c('a', 'a', 'b','b','c','c')
ET <- c(5, 7, 8, 3, 4, 6)
df_1 = data.frame(image_index, ET)
Second
image_index <- c('a', 'b','c')
clouds <- c(0, 2, 0.5)
df_2 = data.frame(image_index, clouds)
I would like to join them so that each row in df_1 would have corresponding cloud cover value. So it would look like this
image_indexET clouds
a 5 0
a 7 0
b 8 2
b 3 2
c 4 0.5
c 6 0.5
I have tried to use merge, but the result I was able to get was different from what I wanted.
Thank you in advance!