[R] rpois formula

Duncan Murdoch murdoch at stats.uwo.ca
Wed Oct 7 12:31:38 CEST 2009


nedmt60 wrote:
> Hi all,
>
> It's been a while since i've used R and I can't remember how to do the
> following:
>
> i have
>
> a = rpois (100000, x)
> b = rpois (100000, y)
>
> what is the code to show that a>b, b>a and a=b to show just the number of
> occurances?
> at the moment when I type a>b I get a nice long list of true or false.
>
> so i'm hoping to have the following
>   

 > a = rpois (100000, 2)
 > b = rpois (100000, 3)
 > table(sign(a-b))

   -1     0     1
58712 16550 24738

Duncan Murdoch
> a>b
>   
>> 35000
>>     
> b>a
>   
>> 25000
>>     
> a=b
>   
>> 40000
>>     
>
> thanks in advance
>




More information about the R-help mailing list