my original frame date
DF1<- data.frame(
plot = I(c("A", "B", "C", "D", "E")),
value = c(1:5)
)
DF2 <- data.frame(
plot= I(c("A", "A", "B",
"B", "B", "C", "D","D","E","E","E")),
sp = c("sp1",
"sp2",
"sp1",
"sp2", "sp3","sp2","sp3","sp4","sp1","sp2","sp4"),
value = NA)
the data frame that you would like to get after merge the two original date frame
DF.result <- data.frame(
plot= I(c("A", "A", "B",
"B", "B", "C", "D","D","E","E","E")),
sp = c("sp1",
"sp2",
"sp1",
"sp2", "sp3","sp2","sp3","sp4","sp1","sp2","sp4"),
value = c(rep(1,2),rep(2,3),3,rep(4,2),rep(5,3))