I am new to R. I have to repeat some process several times. In each iteration, I have to take a sub-sample from a data-frame, and to save the output which already is an array as rows of a matrix. To take sub-sample I am using
mysample <- mydata[sample(1:nrow(mydata), 200,replace=T),]
and to save output in 'finmat' matrix
finmat<- matrix(nrow=100, ncol=7) # initialization with 100 iteration
in each iteration suppose looping index is k
,
finmat[k,]<- rs
where rs
is vector of length 7.
help me to accomplish this task.