[R] extracting submatrix from a bigger one

matteo matteo.ghetta at gmail.com
Mon Jun 24 20:31:55 CEST 2013


First of all, thanks for all the replies!!
What you have written helps, but is not entirely the answer to my problem.

What I'd have is the creation of new data.frames each of one named with 
the ID of the original dataframe and with all the columns.

For example, in the original dataframe one column (ID) has 5 different 
elements:

ID    value1    value2
x1        10            12
x1        12            22
x1        11            9
x2        15            10
x3        11            11
x3        13            8

I need a command ables to split the dataframe in other smallest and 
separated dataframes, so that they look like

x1 is
ID    value1    value2
x1        10            12
x1        12            22
x1        11            9

x2 is
ID    value1    value2
x2        15            10

and x3 is
ID    value1    value2
x1        10            12
x3        11            11
x3        13            8


Sorry if I'm not able to explain it better and as I said I'm very new to 
R.....

Thanks

Matteo



More information about the R-help mailing list