I have two matrixes,

red:

a 123
c 200
d 400
e 650
g 127
f 100

and blue:

a 10
b 20
c 30
d 40
e 50
f 60
g 70

is there any easy way to get the next matrix:

a 10 123
b 20 0
c 30 200
d 40 400
e 50 650
f 60 100
g 70 127

i.e. to add in the third column of blue the [,2] values of red corresponding
to the file with same [x,1] value of blue, adding a cero in the case that
there is no
[x,1] corresponding value in the red matrixes (case for row 2 of blue).
Thanks in advance,


juan



Juan Pablo Fededa

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to