[R] Newbie cross tabulation issue

John Kane jrkrideau at yahoo.ca
Thu Sep 9 16:08:49 CEST 2010


It would help if you included a bit of sample data. See ?dput as a way of doing this.

Also a good place to start is by looking at the package "reshape". Have a look at http://had.co.nz/reshape/ for some information on the package.

--- On Wed, 9/8/10, Jonathan Finlay <jmfinlayp at gmail.com> wrote:

> From: Jonathan Finlay <jmfinlayp at gmail.com>
> Subject: [R] Newbie cross tabulation issue
> To: r-help at r-project.org
> Received: Wednesday, September 8, 2010, 6:40 PM
> hi, i'm new in R and i need some
> help. Please, ¿do you know a function how
> can process cross tables for many variables and show the
> result in one table
> who look like this?:
> 
> +----------------------------------------------------+
> |------------------ |        X
> variable           |
> |----------------- | Xop1 | Xop2 | Xop3|.....|
> +----------------------------------------------------+
> |Yvar1 | Total | %row..........................|
> |         |  Op1 | 
> %row..........................|
> |         |  Op2 | 
> %row..........................|
> |+---------------------------------------------------+
> |Yvar2 | Op1 |  %row..........................|
> |         | Op2 | 
> %row...........................|
> +----------------------------------------------------+
> |Yvar3 | Op1 |  %row..........................|
> |         | Op2 | 
> %row...........................|
> |         | Op3 | 
> %row...........................|
> |+---------------------------------------------------+
> 
> Like a pivot table!
> 
> thanks a lot.
> 
> -- 
> Jonathan.
> 
>     [[alternative HTML version deleted]]
> 
> 
> -----Inline Attachment Follows-----
> 
> ______________________________________________
> R-help at r-project.org
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
> 





More information about the R-help mailing list