[R] assign question

Erin Hodgess erinm.hodgess at gmail.com
Mon Jul 20 20:26:05 CEST 2009


Dear R People:

I have several vectors, sa1, sa2,...sa27 of varying lengths.

I want to produce one vector xener[1:27] which has the minimum of each sa[i].

I'm trying to set up a loop and use the assign statement, but here are
my results:

> for(i in 1:27) {
+ xener[i] <- min(assign(paste("sa",i,sep="")))
+ }
Error in assign(paste("sa", i, sep = "")) :
  element 2 is empty;
   the part of the args list of '.Internal' being evaluated was:
   (x, value, envir, inherits)
>

Any suggestions would be most welcome.

Thanks in advance,
Erin


-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess at gmail.com




More information about the R-help mailing list