| To: | "'Manuel Voelkle'" <manu.voelkle@gmx.de>, <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | Re: hypergeometric distribution |
| From: | "Alan Hochberg" <alan.hochberg@prosanos.com> |
| Date: | Thu, 27 Jan 2005 16:54:16 -0500 |
| In-reply-to: | <00a701c504b8$2aea0300$6902a8c0@sky> |
| Thread-index: | AcUEuKNKT6AShoyPSxWa5EXT2/tuAgAAYtrA |
Manuel,
The sample() function should do what you want, like this:
> drawing <- function(m,n,k) { sample(c(rep(0,m),rep(1,n)),size=k) }
> drawing(1,10,7)
[1] 1 1 1 1 1 0 1
> drawing(5,5,10)
[1] 1 1 0 1 1 1 0 0 0 0
> drawing(5,5,10)
[1] 0 0 0 0 1 1 1 0 1 1
Alan
Alan Hochberg
Vice President, Research
ProSanos Corp.
225 Market Street
Suite 502
Harrisburg, PA 17101
Tel. 717-635-2124
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | hypergeometric distribution, Manuel Voelkle |
|---|---|
| Next by Date: | Re: com.insightful.gdevice.SGraphCommand, Day, Roger |
| Previous by Thread: | hypergeometric distribution, Manuel Voelkle |
| Next by Thread: | JOB: Software Architect, Insightful Seattle, David Smith |
| Indexes: | [Date] [Thread] [Top] [All Lists] |