I have two data.frames that I want to merge together. The first is:
datess <- seq(as.Date(\'2005-01-01\'), as.Date(\'2009-12-31\'), \'days\') sample<-
If y and Z are always zero in sample you do not need them there, so all you have to do is join on year like this:
y
Z
sample
library(dplyr) sample %>% mutate(a = format(Date, "%Y") %>% as.numeric) %>% inner_join(a %>% select(a))