[R] merge

n.vialma at libero.it n.vialma at libero.it
Tue Jun 15 12:37:39 CEST 2010


Dear list I have two different data frame
the first one is like this


CLUSTER             year          variable        value
m1                          2006         EC01              4
m1                          2007         EC01              5
m2                          2006          EC01             42
m2                          2007          EC01            9


and other variables this data frame has 800 number of rows and 14 number of 
columns

the second data frame has more or less the same structure
CLUSTER             year
m1                           2005
m1                          2006
m1                          2007
m2                           2005
m2                          2006
m2                          2007

This data frame has 548833 number of rows and 18 number of columns

What im trying to do is to merge the Year columns of the second data frame 
with the whole First data frame in order to get the following new data frame
CLUSTER             year          variable        value
m1                          2005         EC01             /
m1                          2006         EC01             4
m1                          2007         EC01             5
m2                          2005        EC01            /
m2                          2006          EC01            42
m2                          2007          EC01            9

Someone could help me???
Thanks a lot



More information about the R-help mailing list