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:
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)
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
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
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
5 matches
Mail list logo