Hi Sebastian, Probably, but I suspect the "correct" answer is simply do not do it that way. Instead of:
test1 <- 1:10 test2 <- 11:20 ... test5 <- 41:50 testt5[7] <- .435 do test <- list(1:10, 11:20, 21:30, 31:40, 41:50) then it is as easy as test[[5]][7] <- .435 Cheers, Josh On Wed, Jun 20, 2012 at 12:59 AM, Leuzinger Sebastian <sebastian.leuzin...@env.ethz.ch> wrote: > Dear all > > Is there a more efficient way of achieving the following (assigning to an > indexed vector in a loop): > > test5 <- 1:10 > eval(parse(text=paste("test",5,"[",7,"]<- ",0.435,sep=""))) > > this works, but it is probably very slow. > > Thanks > Sebastian Leuzinger > ______________________________________________ > 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. -- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, Statistical Consulting Group University of California, Los Angeles https://joshuawiley.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.