For is taking the rest of the sample variables into R

1

I am making a sample and its size is in a worksheet called "tamamostra". When I use the for command, as below, the sample is made, but only the first column appears for each sample, I would like the whole database to appear for each sample.

bons1<-0
for(i in 2:14){
bons1[i]<-subset(bons,data==tamamostra[1,i]) 
[sample(nrow(subset(bons,data==tamamostra[1,i])), tamamostra[3,i]), ]
}

When I do this without a for, 1 to 1, the command works perfectly. Where can I be going wrong? In addition, some warnings of the type appear:

number of items to replace is not a multiple of replacement length
    
asked by anonymous 17.07.2018 / 21:39

0 answers