I have two data frames with a unifying index v1. I need to create a third data frame with no NA values, if a number is available.
I have tried various combinations of the join functions from dplyr and the rbind.fill function in plyr.
# Given
v1 <- c("a", "b", "c", "d")
df1 <- cbind.data.frame(v1, v2 = c(1,NA,3,NA))
df2 <- cbind.data.frame(v1, v2 = c(NA,2,NA,4))
# I would like
df3 <- cbind.data.frame(v1, v2 = c(1,2,3,4))
How can I make this possible?