[Solved] Pass sequentially named variables to functions within a loop in R


Solved it with eval and parse:

  for(i in 1:length(vec)){
    assign(paste("holder",i,sep=""),vec[i])
    print ( paste ("holder",i,sep="") )
    positions<-c(positions,grep( eval( parse(text= paste ("holder",i,sep="")) ),colnames(data),ignore.case=TRUE))
  }

solved Pass sequentially named variables to functions within a loop in R