http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
Loops are seldom a good solution in R so some more information and data would be useful At the simplist, for your specific question I think you could set up two vectors (e.g. v1 <- rep(NA, 10 ) and just write the values into the vectors as you proceed through the loop. John Kane Kingston ON Canada > -----Original Message----- > From: bayywa...@gmail.com > Sent: Sun, 7 Apr 2013 14:36:33 +1200 > To: r-help@r-project.org > Subject: [R] While loop history > > Hi, > I am new at R and still trying to get the hang of things. > I am running a while loop and wish to save the results of each iteration. > The results are a vector x of length two and I wish to save the results > of > each iteration as two vectors, one for x[1] and the other for x[2]. > > Thanks! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ____________________________________________________________ GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.