Skip to content
Back to formatted view

Raw Message

Message-ID: <971536df0612311050nb8c3578s23eacfeed4dfe5ab@mail.gmail.com>
Date: 2006-12-31T18:50:34Z
From: Gabor Grothendieck
Subject: tabulate: switching columns and rows
In-Reply-To: <s5980d3c.098@niloufer.xen.net>

Add the argument col.vars = 2:3 to your ftable call.  See ?ftable

On 12/31/06, Ricardo Rodr?guez <webmaster at xen.net> wrote:
> Hi all,
>
> Please, is there any way of controlling factors in row/columns when using ftable/xtabs? As far as I can see, the last cross-clasifing variable in the formula will appear in columns. The previous ones, in rows. For instance, is it possible to make  tension and replicate appear in columns?
>
> ftable(xtabs(breaks ~ wool + tension + replicate, data = warpbreaks))
>
> After some years using SAS proc tabulate I am afraid I don't get the point with R and cross-tabulation :-(
>
> Thanks you very much and Happy New Year!
>
> Ricardo
>
> ---
> Ricardo Rodr?guez
> Your XEN ICT Team
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>