I have two lists, which I want to use to create a new list that is a product of the length of the two lists. I have code that does this with for loops, but I would like to do it in one line with something vectorized like lapply or map2. Thanks!
years <- c(1999, 2000, 2001)
file <- list("tmin", "tmax")
var <- vector()
for(ys in years){
#determine which days need to be extracted
for(f in file){
var <- append(var, paste0(f, ".", ys, ".nc"))
}
}