So consider the following chunk of code which does not work as most people might expect it to
#cartoon example a <- c(3,7,11) f <- list() #manual ini
Will this approach work for you?
ff<-list() for(i in 1:3) { fillit <- parse(text=paste0('a[',i,']+x' )) ff[[i]] <- function(x) '' body(ff[[i]])[1]<-fillit }
It's sort of a lower-level way to construct a function, but it does work "as you want it to."