Re: [R] ugly loop

From: Bill Simpson <William.Simpson_at_drdc-rddc.gc.ca>
Date: Fri 22 Apr 2005 - 23:17:29 EST


To clarify: I want to get rid of the loop over i,j Here is a simpler example. ver is a 2D matrix

count<-0
for(i in 1:nrow(ver))
  for(j in 1:ncol(ver))
    {
    count<-count+1
    x[count]<-ver[i,j]
    }

Bill



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Apr 22 23:24:58 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:22 EST