[R] tabulate: switching columns and rows

2006-12-31 Thread Ricardo Rodríguez
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

Re: [R] tabulate: switching columns and rows

2006-12-31 Thread hadley wickham
Hi Ricardo, 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

Re: [R] tabulate: switching columns and rows

2006-12-31 Thread Ricardo Rodríguez - Your XEN ICT Team
hadley wickham[EMAIL PROTECTED] 31/12/2006 19:33 Hi Ricardo, You might want to have a look at the reshape package, http://had.co.nz/reshape, which provides a more general and flexible framework for reshaping data in R. The version of warpbreaks I have doesn't have the replicate variable, so

Re: [R] tabulate: switching columns and rows

2006-12-31 Thread Gabor Grothendieck
Add the argument col.vars = 2:3 to your ftable call. See ?ftable On 12/31/06, Ricardo Rodríguez [EMAIL PROTECTED] 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

Re: [R] tabulate: switching columns and rows

2006-12-31 Thread hadley wickham
Thanks, Hadley, My fault: I've not provided the line concerning replicate variable. It is included in ?xtabs: warpbreaks$replicate - rep(1:9, len = 54) It will be great to have an example with these given data. Anyway, I will have a look to reshape at the given site. Thanks a lot!