| To: | "'Overstreet, Jason (FL51)'" <Jason.Overstreet@honeywell.com>, s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | Re: Question about random number generation in a user defined |
| From: | "Austin, Matt" <maustin@amgen.com> |
| Date: | Thu, 22 Dec 2005 11:00:17 -0800 |
|
If I'm
understanding what you need, I think sample() would do what you
want.
x
<- sample( 0:4, 100, replace=TRUE)
Check
?sample for all the options.
--Matt
-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu]On Behalf Of Overstreet, Jason (FL51) Sent: Thursday, December 22, 2005 10:39 AM To: s-news@lists.biostat.wustl.edu Subject: [S] Question about random number generation in a user defined functio n If you run this function you will randomly have an output of 0, 1, 2, 3, or 4. What I would like to know how to do is to: I am thinking that some sort of a loop is mandatory in this situation. Any pointers? <<ET1.ssc>> Jason Overstreet |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Question about random number generation in a user defined functio n, Overstreet, Jason (FL51) |
|---|---|
| Next by Date: | Re: Question about random number generation in a user defined, David L Lorenz |
| Previous by Thread: | Question about random number generation in a user defined functio n, Overstreet, Jason (FL51) |
| Next by Thread: | Re: Question about random number generation in a user defined, David L Lorenz |
| Indexes: | [Date] [Thread] [Top] [All Lists] |