?t # I knew it worked with matrices so seemed reasonable to see if it worked on tables.

> t(with(warpbreaks, table(wool, tension)) )
       wool
tension A B
      L 9 9
      M 9 9
      H 9 9
> with(warpbreaks, table(wool, tension))
    tension
wool L M H
   A 9 9 9
   B 9 9 9

On Apr 5, 2009, at 3:56 PM, Donald Braman wrote:

Is there an easy way to invert a table? (not to solve for the inverted matrix, just swap rows for columns & vice versa). I've gone through my data
manipulation bible (Phil Spector's book), but to no avail.

        [[alternative HTML version deleted]]

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@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.

Reply via email to