[R] Make a table

Muhammad Subianto subianto at cs.uu.nl
Wed Dec 22 15:35:50 CET 2004


Thanks to all of you.
That's what I want.

Best wishes,
Muhammad Subianto


Try

tapply(prevRND.dat$Z, list(X=prevRND.dat$X, Y=prevRND.dat$Y), mean)

__________________________________
Andy Jaworskitry:


try:

tapply( Z, list( X, Y ), mean )

----------------------
Bendix Carstensen
How about:


>> xtabs(Z ~ X + Y, data = prevRND.dat)
>  
>
   Y
X   A        B        C       
  A 0.950933 0.143600 0.956133
  B 0.000533 0.986467 0.032066
  C 0.005333 0.000000 0.009266

HTH,

Marc Schwartz




More information about the R-help mailing list