I want to merge two imported dataset with different lengths and keep the values from B if both datasets has values. Dataset A has daily data from 1970 to 2016, dataset B has daily data from 1980 to 2016. The combined dataset should be the same length as A, but with values from B stuffed into it. Example data:
a=matrix(c(1:10),10,10)
b=matrix(c(NA,NA,3:8,NA,NA),10,5)