[R] transposing data.frames

2007-06-25 Thread Christoph Heibl
Hello,
This must be simple...
Thanks a lot
- Christoph

# Imagine you have a list, e.g:

K - list(1:10, 2:11, 9:18)
K

# Transforming to dataframe...

KK - as.data.frame(K)

# ... one obtaines the list elements as column.

KK

# But I need the list elements as rows
# How can I achieve this? Is there a simple way to transpose  
data.frames?

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


Re: [R] transposing data.frames

2007-06-25 Thread Stefan Grosse

 Original Message  
Subject: [R] transposing data.frames
From: Christoph Heibl [EMAIL PROTECTED]
To: R-help@stat.math.ethz.ch
Date: 25.06.2007 15:13
 Hello,
 This must be simple...
 Thanks a lot
 - Christoph

 # Imagine you have a list, e.g:

 K - list(1:10, 2:11, 9:18)
 K

 # Transforming to dataframe...

 KK - as.data.frame(K)

 # ... one obtaines the list elements as column.

 KK

 # But I need the list elements as rows
 # How can I achieve this? Is there a simple way to transpose  
 data.frames?
   

yes:
t(as.data.frame(K))

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




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


Re: [R] transposing data.frames

2007-06-25 Thread David Barron
t(KK) will transpose your data frame

On 25/06/07, Christoph Heibl [EMAIL PROTECTED] wrote:
 Hello,
 This must be simple...
 Thanks a lot
 - Christoph

 # Imagine you have a list, e.g:

 K - list(1:10, 2:11, 9:18)
 K

 # Transforming to dataframe...

 KK - as.data.frame(K)

 # ... one obtaines the list elements as column.

 KK

 # But I need the list elements as rows
 # How can I achieve this? Is there a simple way to transpose
 data.frames?

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



-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

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