Re: [R] assign question

2009-07-20 Thread Albyn Jones
I don't think you want assign() here. > x1 = rnorm(20) > min(x1) [1] -0.9723398 > min(eval(paste("x",1,sep=""))) # not the solution [1] "x1" > min(eval(as.name(paste("x",1,sep="" # a solution [1] -0.9723398 try: for(i in 1:27) { xener[i] <- min(eval(as.name((paste("sa",i,sep="")

Re: [R] assign question

2009-07-20 Thread David Huffer
How about: sapply ( 1:27 , function ( i ) { min ( get ( paste ( "sa" , i , sep = "" ) ) ) } ) See ?get david -- David   - David Huffer, Ph.D. Senior Statistician CSOSA/Washington, D