Re: [R] Columns and rows

2012-10-14 Thread Santana Sarma
X7 X8 X9 X10 X11 X12 > Col1 A E H B F I C G J D K > > -- > David L Carlson > Associate Professor of Anthropology > Texas A&M University > College Station, TX 77843-4352 > > > > -Original Message- > >

Re: [R] Columns and rows

2012-10-12 Thread David L Carlson
Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of arun > Sent: Thursday, October 11, 2012 11:26 PM > To: Santana Sarma > Cc: R help > Subject: Re: [R] Columns and rows > > HI, > Try this: > dat1<-

Re: [R] Columns and rows

2012-10-11 Thread Jeff Newmiller
Better, but you didn't do your reading. Seriously... learn to make it reproducible... you will get quicker help from more skilled R users. Also, post in text, not HTML. Note that data frames are not really the right data structure for doing the kinds of operations you are describing below, si

Re: [R] Columns and rows

2012-10-11 Thread arun
,1]) #   col1 #1 A #2 B #3 C #4 D #5 E #6 F #7 G #8 K #9 H #10    I #11    J #12 dat5<-do.call(data.frame,sapply(dat3,list))  dat5 #  A E H B F I C G J D K X.. #1 A E H B F I C G J D K    A.K. - Original Message - From: Santana Sarma To: Davi

Re: [R] Columns and rows

2012-10-11 Thread Santana Sarma
Hi, Trying to give an example here. Say, I have read in a .csv file using read.csv (), and the file contains the following info. Names Col x Col y Col z rowName1 A E H rowName2 B F I rowName3 C G J rowName4 D K Now, this is what is required: 1. Combine/stack/join contents from -

Re: [R] Columns and rows

2012-10-11 Thread David Winsemius
On Oct 11, 2012, at 5:55 PM, Santana Sarma wrote: > Hi, > > Could you please advice some easy way to do the following for a dataframe > (header=F) having unequal column- & row- length. > > 1. Combine/stack/join contents from - > a) multiple rows into one column. > b) m

Re: [R] Columns and rows

2012-10-11 Thread Jeff Newmiller
Data frames don't have unequal column or row lengths within a single object. Your terminology is obscuring your intent. Perhaps you should read the posting guide for guidance on posting here and then generate a reproducible example. Since you seem to be having difficulty with the "how", at least

[R] Columns and rows

2012-10-11 Thread Santana Sarma
Hi, Could you please advice some easy way to do the following for a dataframe (header=F) having unequal column- & row- length. 1. Combine/stack/join contents from - a) multiple rows into one column. b) multiple columns into one row. 2. Stack contents from multiple col