Skip to content
Back to formatted view

Raw Message

Message-ID: <CAAmySGNLx9BobdXr9XSRXM89dn-FxHFRBpnfL+9xPyuzWMNS2g@mail.gmail.com>
Date: 2011-12-03T19:11:46Z
From: R. Michael Weylandt
Subject: Iteration in R
In-Reply-To: <1322935838.52212.YahooMailNeo@web121702.mail.ne1.yahoo.com>

? replicate

or a for loop

or do all one hundred simulations at once

x <- matrix(rnorm(100^2, 1, 2), 100)

It's going to depend on what you want to do with the numbers.

Michael

On Sat, Dec 3, 2011 at 1:10 PM, Martin Zonyrah <martin2005z at yahoo.com> wrote:
> Hi,
> I need help. I am trying to iterate this command? x <- rnorm(100, 1.0, 2.0) one hundred times in R but I don't seem to have a clue.
> Can anyone help?
> Your help is very much appreciated.
>
> Martin
>
> ? ? ? ?[[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.
>