[R] numbers loop in R

2009-04-17 Thread emj83
] [,3] [,4] [1,] NaN NaN NaN NaN [2,] NaN NaN NaN NaN [3,] NaN NaN NaN NaN [4,] NaN NaN NaN NaN [5,] NaN NaN NaN NaN [6,] NaN345 Could anyone give me a hand? Would be much appreciated. Thanks Emma -- View this message in context: http://www.nabble.com/numbers-loop

Re: [R] numbers loop in R

2009-04-17 Thread David Winsemius
://www.nabble.com/numbers-loop-in-R-tp23099591p23099591.html Sent from the R help mailing list archive at Nabble.com. __ 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

Re: [R] numbers loop in R

2009-04-17 Thread jim holtman
 NaN  NaN  NaN [6,]  NaN    3    4    5 Could anyone give me a hand? Would be much appreciated. Thanks Emma -- View this message in context: http://www.nabble.com/numbers-loop-in-R-tp23099591p23099591.html Sent from the R help mailing list archive at Nabble.com

Re: [R] numbers loop in R

2009-04-17 Thread hadley wickham
On Fri, Apr 17, 2009 at 12:19 PM, jim holtman jholt...@gmail.com wrote: try this: matrixx-function(A){ +     B=matrix(NaN,nrow=(A+1),ncol=4) +     k - 1 +     for (i in 3:A){ +         for (j in i:A) { +             B[k,] - c(NaN, i-2, i-1, j) +             k - k + 1 +         } +     }