[R] sample() issue

Nordlund, Dan (DSHS/RDA) NordlDJ at dshs.wa.gov
Mon Dec 20 20:39:50 CET 2010


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of cory n
> Sent: Monday, December 20, 2010 11:04 AM
> To: r-help at r-project.org
> Subject: [R] sample() issue
> 
> > length(sample(25000, 25000*(1-.55)))
> [1] 11249
> 
> > 25000*(1-.55)
> [1] 11250
> 
> > length(sample(25000, 11250))
> [1] 11250
> 
> > length(sample(25000, 25000*.45))
> [1] 11250
> 
> So the question is, why do I get 11249 out of the first command and not
> 11250?  I can't figure this one out.
> 
> Thanks
> 
> Cory

See FAQ 7.31

Then try

>.45 == (1-.55)

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



More information about the R-help mailing list