] [,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
://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
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
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
+ }
+ }
4 matches
Mail list logo