[R] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice

Romain Francois francoisromain at free.fr
Wed Feb 8 09:51:26 CET 2006


Le 08.02.2006 04:21, Taka Matzmoto a écrit :

>Hi R users
>
>This looks a simple question
>
>Is there any difference between between rnorm(1000,0,1) and running 
>rnorm(500,0,1) twice in terms of outcome ?
>
>TM
>  
>
Not here :

R> set.seed(1)
R> x <- rnorm(1000, 0, 1)
R> set.seed(1)
R> y <- rnorm(500, 0, 1)
R> z <- rnorm(500, 0, 1)
R> all(x == c(y,z))
[1] TRUE

Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---------------------------------------------------------------+
| Romain FRANCOIS - http://francoisromain.free.fr               |
| Doctorant INRIA Futurs / EDF                                  |
+---------------------------------------------------------------+




More information about the R-help mailing list