Re: [R] how to generate uniformly distributed random integers

From: Jared O'Connell <jared.oconnell_at_gmail.com>
Date: Fri, 7 Dec 2007 09:07:04 +0100

You could use sample eg.

> sample(1:10,5,replace=T)

[1] 1 5 4 6 3

but there may be a more approriate function.

On Dec 7, 2007 8:59 AM, kexinz <zhangchicool_at_gmail.com> wrote:

>
> I'm a beginner of R.
> I can use runif() to generate uniformly distributed numbers, but I don't
> know which function can generate uniformly distributed random integers, or
> what kind of method do?
> Thanks!
> --
> View this message in context:
> http://www.nabble.com/how-to-generate-uniformly-distributed-random-integers-tf4960778.html#a14208376
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>

        [[alternative HTML version deleted]]



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 Fri 07 Dec 2007 - 08:11:23 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 Fri 07 Dec 2007 - 08:30:17 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.