Here's a stack overflow question addressing the same issue. 
http://stackoverflow.com/a/22261345
Hopefully it will help.
Thanks
> Date: Wed, 23 Jul 2014 12:33:11 -0300
> From: khurram.nadee@gmail.com
> To: r-help@r-project.org
> Subject: [R] Importing random subsets of a data file
> 
> Hi R folks,
> 
> Here is my problem.
> 
> *1.* I have a large data file (say, in .csv or .txt format) containing 1
> million rows and 500 variables (columns).
> 
> *2.* My statistical algorithm does not require the entire dataset but just
> a small random sample from the original 1 million rows.
> 
> *3. *This algorithm needs to be applied 10000 times, each time generating a
> different random sample from the 'big' file as described in (2) above.
> 
> Is there a way to 'import' only a (random) subset of rows from the .csv
> file without importing the entire dataset? A quick search on various R
> forums suggest that read.table() does not have this functionality.
> Obviously, I want to avoid importing the whole file because of memory
> issues. Looking forward to your help.
> 
> Thanks,
> Khurram
> ------------------------
>  Khurram Nadeem
>  Postdoctoral Research Fellow
>  Department of Mathematics & Statistics
>  Acadia University, NS, Canada.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.
 		 	   		  
	[[alternative HTML version deleted]]

