I guess there will be a very simple answer to this. But here goes.
Data in long format. like this
d <- data.frame(cbind(numbers = rnorm(10), year = rep(c(2008, 2009), 5), name = c("john", "David", "Tom", "Kristin", "Lisa","Eve","David","Tom","Kristin","Lisa")))
How do I get a new dataframe only with rows for names that occur in both 2008 and 2009? (i.e. with only David, Kristin, Lisa and Tom).
Thanks in advance