probably this is a typo and you meant :
test<-filter(data, prodDate==1999)
test2<-select(test,prod)
mean(test2)
if your data has NA's in prod, this wont have addressed them
test<-filter(data, prodDate==1999) %>% select(prod) %>% na.omit()
mean(test)
or
test<-filter(data, prodDate==1999) %>% select(prod)
mean(test,na.rm=TRUE)