[R] eval parse question

Leuzinger Sebastian sebastian.leuzinger at env.ethz.ch
Wed Jun 20 09:59:25 CEST 2012


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


More information about the R-help mailing list