Re: [R] read.xls -> rotate data.frame

From: Bert Gunter <gunter.berton_at_gene.com>
Date: Fri, 25 Mar 2011 10:10:16 -0700

It does not appear to have been clearly noted in this thread that one CANNOT "rotate" a data frame. Data frames are designed to contain mixed types in their columns, which means that to "rotate" the frame, the rows would have to be coerced to a single type, thereby most likely losing the information. So the answer to the question is: read ?data.frame to understand why the question is bogus.

matrices (or arrays) are a single type and can be simply "rotated" (transposed) by ?t (or more generally have their indices permuted by ?aperm). You would have to manually handle row and column names, however. See ?dimnames

On Fri, Mar 25, 2011 at 9:52 AM, Knut Krueger <rh_at_knut-krueger.de> wrote:
> Am 25.03.2011 14:51, schrieb Philipp Pagel:
>>
>> The frame$y2 notation still only works for columns, of course.
>> Maybe, if you tell us some more about your actual analysis,
>> more help can be provided.
>
> Thank,s  but the only question was to use a common notation like for columns
> if the excel sheet was build rotated.
>
> Its more easy for beginners to use the column notation than the row notation
> from a data.frame.
> One solution is to rotate the excel sheet, but than you have multiple data.
> So I was looking for a solution to rotate the data set in R
>
> I think I will explain them the row notation for a data.frame
>
> Thank you Knut
>
> ______________________________________________
> 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.
>

-- 
Bert Gunter
Genentech Nonclinical Biostatistics

______________________________________________
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.
Received on Fri 25 Mar 2011 - 17:12:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Mar 2011 - 17:50:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive