[R] converting a data-frame by a defined rule

2008-12-15 Thread Jörg Groß
Hi, I have a data frame with several columns. Now I want to transfer the data into a new variable (also a data frame), but I only want a part of the data, defined by a rule ... for example; I have following data frame: row1row2row3 x 2 3 x

Re: [R] converting a data-frame by a defined rule

2008-12-15 Thread Jorge Ivan Velez
Dear Jörg, Try this: # Data DF=read.table(textConnection(" row1row2row3 x 2 3 x 1 4 y 5 3 y 2 3"),header=TRUE) closeAllConnections() # Splitting res=with(DF,split(DF,row1)) res

Re: [R] converting a data-frame by a defined rule

2008-12-15 Thread David Winsemius
Another method : > DF[DF$row1 == "x", ] row1 row2 row3 1x23 2x14 On Dec 15, 2008, at 8:51 PM, Jorge Ivan Velez wrote: Dear Jörg, Try this: # Data DF=read.table(textConnection(" row1row2row3 x 2 3 x 1 4