hello I think if you try this: for(j in 1: length(nsample)){ MEANS[,]<-create.means.one.size(j,var,nboot) } it will work -- View this message in context: http://r.789695.n4.nabble.com/Matrix-manipulation-in-for-loop-tp3525849p3525888.html Sent from the R help mailing list archive at Nabble.com.