Re: [R] rbind in a loop with " : " elements

2012-08-22 Thread bilelsan
You are a GENIUS !! I don't know how to thank you !! Thank you so much ! I really need to improve my R language (I take any advice) If i can do something for you about MGARCH models, let me know Thx again Bilel Le Aug 22, 2012 à 8:55 PM, Rui Barradas [via R] a écrit : > Hello, > > I'm being

Re: [R] rbind in a loop with " : " elements

2012-08-22 Thread Rui Barradas
Hello, I'm being lazy, but the following works. r = 3 ; set.seed(1) v <- matrix(c(rnorm(40)),10,4) result <- vector("list", r*ncol(v)) ires <- 0 for (j in 1:4){ for (i in 1:r){ x <- t(v[,j]^(i)*v[,1:4]^((r-(4-1)):r)) #print(x) ires <- ires + 1 result[[ ires

[R] rbind in a loop with " : " elements

2012-08-22 Thread bilelsan
Dear Ruser, Below, the deal (you can copy paste): r=3 ; set.seed(1) v <- matrix(c(rnorm(40)),10,4) for (j in 1:4){ for (i in 1:r){ x <- t(v[,j]^(i)*v[,1:4]^((r-(4-1)):r)) print(x) } } How to reach to " x " " row bind " inside or outside (preferred) of the loop. T