Re: [R] Sampling

From: Daniel Dunn <daniel_at_dunncapital.com>
Date: Tue, 5 Feb 2008 14:02:41 -0500

sample(rep(LETTERS[1:2],12), 24, replace=F)

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of Judith Flores
Sent: Tuesday, February 05, 2008 1:52 PM To: RHelp
Subject: [R] Sampling

Hi there,

   I want to generate different samples using the followindg code:

g<-sample(LETTERS[1:2], 24, replace=T)

   How can I specify that I need 12 "A"s and 12 "B"s?

Thank you,

Judith  




Be a better friend, newshound, and

R-help_at_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.

R-help_at_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. Received on Tue 05 Feb 2008 - 19:05:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 05 Feb 2008 - 19:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive