Re: [R] How to do more advanced cross tabulation in R?

2008-01-23 Thread Domenico Vistocco
You could have a look at the reshape package. Ciao, domenico tom soyer wrote: Hi, I am trying to reproduce some functionalities of Excel pivot table in R, sadly, I couldn't figure out how to do it. I am wondering if this is even possible in R. Does anyone know? Here is an example:

[R] How to do more advanced cross tabulation in R?

2008-01-22 Thread tom soyer
Hi, I am trying to reproduce some functionalities of Excel pivot table in R, sadly, I couldn't figure out how to do it. I am wondering if this is even possible in R. Does anyone know? Here is an example: year=rep(2003,16) quarter=rep(1:4,each=4) sales=1:16 company=rep(c(a,b,c,d),4)

Re: [R] How to do more advanced cross tabulation in R?

2008-01-22 Thread Gabor Grothendieck
I think you are looking for ftable: xt - xtabs(sales ~ company + year + quarter, data = DF) ftable(quarter ~ year + company, xt) You also might want to look at the reshape package and the rpad package. Here is a demo of a pivot table in R using rpad for the user interface and reshape for the

Re: [R] How to do more advanced cross tabulation in R?

2008-01-22 Thread Charles C. Berry
On Tue, 22 Jan 2008, tom soyer wrote: Hi, I am trying to reproduce some functionalities of Excel pivot table in R, sadly, I couldn't figure out how to do it. I am wondering if this is even possible in R. Does anyone know? Using 'ftable()', I can match your format, but the cell values

Re: [R] How to do more advanced cross tabulation in R?

2008-01-22 Thread tom soyer
Thanks Charles and Gabor! Sorry Charles, the numbers were wrong in my example. You had the correct one. On 1/22/08, Charles C. Berry [EMAIL PROTECTED] wrote: On Tue, 22 Jan 2008, tom soyer wrote: Hi, I am trying to reproduce some functionalities of Excel pivot table in R, sadly, I