then use

x <- c(t(ver))


Best, --D

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
    http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- From: "Bill Simpson" <[EMAIL PROTECTED]>
To: "r-help" <r-help@stat.math.ethz.ch>
Sent: Friday, April 22, 2005 3:17 PM
Subject: Re: [R] ugly loop



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



______________________________________________ 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

Reply via email to