[R] code to iterate function apply to matrix

2012-05-16 Thread umai88
I got this code below and i want to repeat the loop for 100 times.. x-rnorm(60) mat1-matrix(x,nrow=15,ncol=4) trim-numeric(ncol(mat1)) win-numeric(ncol(mat1)) ssd-numeric(ncol(mat1)) for(j in 1:ncol(mat1)) { n=length(mat1[,j]) alpha=0.1 k=floor(alpha*n)+1 r=k-(alpha*n) i=k+1 m=n-k

Re: [R] code to iterate function apply to matrix

2012-05-16 Thread Uwe Ligges
On 16.05.2012 08:11, umai88 wrote: I got this code below and i want to repeat the loop for 100 times.. And what is the problem? What are you aiming at? Uwe Ligges x-rnorm(60) mat1-matrix(x,nrow=15,ncol=4) trim-numeric(ncol(mat1)) win-numeric(ncol(mat1)) ssd-numeric(ncol(mat1)) for(j