I have 2 dataframes:
df1 = data.frame(Bird_ID = c(1:6), Sex = c("Male","Female","Male","Male","Male","UNK"))
df2 = data.frame(Bird_ID = c(6), Seen_sex = c("Female"))
df1
# Bird_ID Sex
# 1 Male
# 2 Female
# 3 Male
# 4 Male
# 5 Male
# 6 UNK
df2
# Bird_ID Seen_Sex
# 6 Female
- My first dataframe (
df1) is my database where I have all my birds with known sex. - My second dataframe (
df2) is the "updater"
How can I update the bird 6 in df1 using information from df2? So "UNK" in df1 should become "Female" now and all other birds stay the same.