rnorm function

16 views
Skip to first unread message

Eduardo_D

unread,
Aug 15, 2008, 6:13:07 PM8/15/08
to CorpLing with R
I would like to have a detailed explanation of the rnorm function,
more complete than the one showed in help(rnorm). Where can I find it?
Thank you very much.

Eduardo Dominiccini

Stefan Th. Gries

unread,
Aug 15, 2008, 6:20:50 PM8/15/08
to corplin...@googlegroups.com
I know no source for that. rnorm is simply this:

set.seed(4)
how.many.random.numbers.do.you.want<-100
what.is.the.approx.mean.of.these.numbers.supposed.to.be<-5 # default=0
what.is.the.approx.standarddeviation.of.these.numbers.supposed.to.be<-2
# default=1

random.numbers<-rnorm(how.many.random.numbers.do.you.want,
what.is.the.approx.mean.of.these.numbers.supposed.to.be,
what.is.the.approx.standarddeviation.of.these.numbers.supposed.to.be)
hist(random.numbers) # looks kinda normal
mean(random.numbers) # close to 5
sd(random.numbers) # close to 2

HTH,
STG
--
Stefan Th. Gries
-----------------------------------------------
University of California, Santa Barbara
http://www.linguistics.ucsb.edu/faculty/stgries
-----------------------------------------------

Eduardo_D

unread,
Aug 19, 2008, 5:24:06 PM8/19/08
to CorpLing with R
Thank you very much Prof. Gries
Reply all
Reply to author
Forward
0 new messages