R sampling command size not correct
> ratio[i]
[1] 0.9
> length(sample(c(1,2,3,4,5,6,7,8,9),2000*ratio[i],replace=T))
[1] 1800
> length(sample(c(1,2,3,4,5,6,7,8,9),2000*(1-ratio[i]),replace=T))
[1] 199
Could someone help me figure out why the third command didn't return 200? Thanks!
• 1,080 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hello John!
We believe that this post does not fit the main topic of this site.
Probably a question better suited for Stack Overflow.
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!