[R] Newbie cross tabulation issue

David Winsemius dwinsemius at comcast.net
Thu Sep 9 00:53:59 CEST 2010


On Sep 8, 2010, at 6:40 PM, Jonathan Finlay wrote:

> 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!
>

?table
?xtabs

... and if you want all those dashes, dots, pluses and pipes   
cluttering up your output a la SAS, then there is:

gmodels::Crosstable

-- 
David.

> thanks a lot.
>
> -- 
> Jonathan.
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list