Re: [R] Generating random normal distribution with mean 0 and standard deviation 1

From: Marc Schwartz <>
Date: Fri 14 Jul 2006 - 22:26:42 EST

On Fri, 2006-07-14 at 08:14 -0400, Neuro LeSuperHéros wrote:
> Hello,
> This must be really simple, but I can't find it on R Site search. I need to
> generate a random normally distributed series with mean 0 and sd 1. In
> Matlab, this code is randn(n).
> The closest I found is runif(20,-1,1) but this forces a maximum and a
> minimum, and there's no way to specify a standard deviation of 1.
> >sd(runif(20,-1,1))
> [1] 0.578164"normal") leads you to "Normal(stats)".

?Normal leads you to rnorm().

More generally,"distributions") will give you an overview of the various distributions available in your installation.

HTH, Marc Schwartz mailing list PLEASE do read the posting guide! Received on Fri Jul 14 22:36:12 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 15 Jul 2006 - 00:14:33 EST.

Mailing list information is available at Please read the posting guide before posting to the list.