[BioC] splitting a data frame

Sean Davis sdavis2 at mail.nih.gov
Thu Apr 26 21:33:27 CEST 2007


kfbargad at ehu.es wrote:
> Dear list,
>
> sorry for this very basic question but I have searched the R manual 
> without success. What function do I need to randomly split a 
> data.frame into two data.frames (for example a data.frame containing 
> 200 rows and 5 columns into two of say 150 and 50 rows each)? Should I 
> first create a vector of 150 random numbers between 1 and 200 (but 
> how?) and then use subset() function?
>   
See the help for sample().

Sean



More information about the Bioconductor mailing list