Re: [R] problems with nested loop

2007-09-18 Thread Matthew Keller
hi Riddle, You subscript is out of bounds because this line: for (j in seq(20,100,20)){ is incorrect - it is trying to index the 20th, 40th, 60th... column of a matrix that has only 5 columns. Try for (j in 1:5) instead. I'm not sure what the purpose of your script is so can't comment on what e

[R] problems with nested loop

2007-09-17 Thread Riddle Chin
Hi, everyone: R is new to me. I am writing a nested loop to simulate data for t-test. The following code is wrong. The subscript is out of bounds. Could anyone tell me how to revise it? Thanks, Riddle Chin. result<-matrix(ncol=5, nrow=1000) colnames(result)<-c('N=20','N=40','N=60','N=8