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

From: michael watson (IAH-C) <michael.watson_at_bbsrc.ac.uk>
Date: Fri 14 Jul 2006 - 22:19:50 EST


See rnorm()

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Neuro LeSuperHéros Sent: 14 July 2006 13:15
To: r-help@stat.math.ethz.ch
Subject: [R] Generating random normal distribution with mean 0 and standarddeviation 1

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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 14 23: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 - 02:14:19 EST.

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