[R] rpois formula

2009-10-07 Thread nedmt60
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 (10, x) b = rpois (10, y) what is the code to show that ab, ba and a=b to show just the number of occurances? at the moment when I type ab I get a nice long list of true or

Re: [R] rpois formula

2009-10-07 Thread Duncan Murdoch
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 (10, x) b = rpois (10, y) what is the code to show that ab, ba and a=b to show just the number of occurances? at the moment when I type ab I get a nice long list

Re: [R] rpois formula

2009-10-07 Thread Peter Dalgaard
David Winsemius wrote: Or: a = rpois (10, 0.1) b = rpois (10, 0.15) table(ab, a==b, ba) table(sign(b-a)) comes to mind too (and table(a,b) is illuminative). -- O__ Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box

Re: [R] rpois formula

2009-10-06 Thread Ian Fiske
try sum(a b) sum(b a) sum(a == b) Ian nedmt60 wrote: i have a = rpois (10, x) b = rpois (10, y) what is the code to show that ab, ba and a=b to show just the number of occurances? at the moment when I type ab I get a nice long list of true or false. -- View this

Re: [R] rpois formula

2009-10-06 Thread David Winsemius
Or: a = rpois (10, 0.1) b = rpois (10, 0.15) table(ab, a==b, ba) And if you look at that output a bit: table(ab,a==b )[c(1,3,2)] # for ab, ba and a=b . # 79049 12712 8239 .. since FALSE TRUE -- On Oct 6, 2009, at 9:49 PM, Ian Fiske wrote: try sum(a b) sum(b a) sum(a == b)