This code works: x<-letters[1:6] ycols<-23:28 xcols<-rep(c(3,4,5,8),each=length(ycols))
somertime<-function(i,j)somers2(Pred_pres_a_indpdt[,i,,], population[,j]) results<-mapply(somertime,xcols,ycols) How can I make variable "h" work? x<-letters[1:6] ycols<-23:28 xcols<-rep(c(3,4,5,8),each=length(ycols)) somertime<-function(h,i,j)somers2(Pred_pres_h_indpdt[,i,,], population[,j]) results<-mapply(somertime,x,xcols,ycols) -R -- View this message in context: http://www.nabble.com/another-automation-question-tp24763017p24763017.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.