Hi all,

Never really managed to build a for-loop with multiple running  
variables in an elegant way.

Can anybody hint ?

See below for an example of what I would like.

EXAMPLE
a<-c(1,2,3)
b<-c("name1","name2","name3")

for( number in a, name in b ) {
        print( number ) ##take a value
        print( name ) ##and have its name available from a second list
}

Does R support this natively ?

thanks !

Piet
(Univ. of Antwerp - Belgium)

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to