Hi everyone, I have a dataset(named "Mydata") which includes 4 different variables named; s1,s2,s3,s4 .Each variable(symptom) has 14 patients. I need to use random sampling to make, 5 different samples from my data with 5 patients in each sample. i.e. using all 4 variables I need to make 5 different samples by changing patients(with 5 patients in each sample).
X8 X9 X10 X102 X110 X177 X283 X284 X286 X292 X297 X306 X308 X314 s1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 s2 0 0 0 0 1 0 0 0 0 0 0 0 1 0 s3 0 1 0 0 0 0 0 0 0 0 0 0 1 0 s4 1 0 0 0 1 0 0 0 0 1 0 0 0 0 I used this code: temp=list(NULL) for(i in 1:5) {temp[i]<-sample(Mydata,5, replace=F)} show(temp) but I get the following error: "number of items to replace is not a multiple of replacement length" any idea why I get this eeror message and how can I fix it? Thanks a lot. -- View this message in context: http://www.nabble.com/Help-Help-with-sampling-tp19994275p19994275.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.