[R] dataframes (The message that once had a suspicious header)

Ernesto Jardim ernesto at ipimar.pt
Thu Mar 20 16:09:17 CET 2003


Hi

I want to combine 2 dataframes (t1 and t2) in order to get a third one
(t3). The dataframes are below.

In SQL I would do something like:

SELECT t1.f1,t1.f2,t1.f3,t2.f4 FROM t1, t2
WHERE t1.f1=t2.f1 AND t1.f2=t2.f2

How can I do it with R ?

Thanks

EJ

> t1
  f1 f2 f3
1  A  C E1
2  A  D E2
3  B  C E3
4  B  D E4
> t2
  f1 f2 f4
1  A  C F1
2  A  C F2
3  B  C F3
4  B  C F4
5  A  D F5
6  A  D F6
> t3
  f1 f2 f3 f4
1  A  C E1 F1
2  A  C E1 F2
3  B  C E3 F3
4  B  C E3 F4
5  A  D E2 F5
6  A  D E2 F6



More information about the R-help mailing list