subset in parallel using a list of dataframes and a list of vectors
问题 This works: onion$yearone$id %in% mask$yearone This doesn't: onion[1][1] %in% mask[1] onion[1]['id'] %in% mask[1] Why? Short of an obvious way to vectorize in parallel columns in DF and in memberids (so I only get rows within each year when ids are present in both DF and memberids), im using a for loop, but I'm not being lucky at finding the right way to express the index... Help? Example data: yearone <- data.frame(id=c("b","b","c","a","a"),v=rnorm(5)) onion <- list() onion[[1]] <- yearone