> -----Original Message-----
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Xebar Saram
> Sent: Thursday, July 22, 2010 3:50 PM
> To: r-help@r-project.org
> Subject: [R] choosing a random sample by precentage
> 
> hi all
> 
> i have found the follwoing way to choose a random sample by sample size
> (200):
> 
> ten_per_T2000 <- F_T2000_All[sample(nrow(F_T2000_All), 200), ]
> 
> 
>  but i wondered if there is a way to choose a sample size by
> precentage (10% etc..)
> 
> thx
> 
> ethan
> 


Maybe something like:

>ten_per_T2000 <- F_T2000_All[sample(nrow(F_T2000_All), 0.1*nrow(F_T2000_All)), 
>]


Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204


______________________________________________
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.

Reply via email to