Consider a data frame like this:
#Create DF
year<-rep(c(2004:2014), each=366)
day<-rep(c(1:366))
df<-data.frame(day, year)
Set up data:
df <- expand.grid(year=2004:2014,day=1:366)
nrow(df) ## 4026
Now exclude cases where (the year is not divisible by 4) AND (day equals 366) (identifying non-leap years would be trickier if you included 2000 and/or century-years in your dataset )
library(dplyr)
df2 <- df %>% filter(!(year %% 4 > 0 & day==366))