[R] random sample from a file

Tibi Codilean Tibi.Codilean at ges.gla.ac.uk
Mon Jun 5 12:09:50 CEST 2006


Dear All,


Thanks to all that responded to my earlier query.


I have a file with two columns: an ID field and a Data field. I wish to extract multiple random samples of 20 numbers from this file in such a way that the ID field is extracted with the data as well. At the moment I am using the 'sample' function but this only extracts the data without the IDs. The file is a comma separated text file and I read it in using read.csv


Could you please tell me if there is a way of doing this such that every random sample contains both the ID and the data.


Thanks



More information about the R-help mailing list