[R] Matrix output from drawing functions

Kjetil Kjernsmo kjetil.kjernsmo at astro.uio.no
Fri Jan 14 16:59:08 CET 2000


Dear all,

I'm a bit confused about the output from functions that generates random
values, e.g. rpois. I'm using 0.65.1 on Digital UNIX alphaev6.

If I say
> rpois(10,5)
output is not unexpectedly:
 [1] 4 6 5 7 6 5 2 2 5 3

but I figured that if I go:
> rpois(10,1:10)
I would get a 10x10 matrix as output, with random values for each of
the vector elements in the row vectors, but I'm getting 
 [1]  3  4  3  4  6  9 10  6 11  9
so, that is obviously not the case... :-) BTW, what am I getting...?

So, I went on to thinking that 
> outer(10, 1:10, rpois)
would do the trick, but no.... Again, what am I getting?

So, is there a simple way of doing this...? If not, would it be reasonable
for me to request this as a feature in future releases?

Best,

Kjetil
-- 
Kjetil Kjernsmo
Graduate astronomy-student                    Problems worthy of attack
University of Oslo, Norway            Prove their worth by hitting back
E-mail: kjetikj at astro.uio.no                                - Piet Hein
Homepage <URL:http://www.astro.uio.no/~kjetikj/>
Webmaster at skepsis.no 


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list