[R] Mapping file-Legend- from 2 Files/Tables

Edwin Sendjaja edwin7 at web.de
Sat Apr 12 06:19:16 CEST 2008


Hello,

I have got 2  Tables from different files:

Table 1 (lets say file: Salesman.data)
------------

      | ID  | User_ID
---------------------------
1    | 1   |   4
2    | 2   |   6
3    | 3   |   7
4    | 4   |   2
5    | 5   |   3


############################
Table2 (file: Employee.data)
----------


      | User_ID  | Name
----------------------------------
1    |       1      |   Donna
2    |       2      |   John
3    |       3      |   Michael
4    |       4      |   Wolf
5    |       5      |   Tim
6    |       6      |   Edward
7    |       7      |   Shaun



What i want do is:


I want to map the table 2 into table 1.
instead of User_ID I want to use the name of the person which is related to 
the User_ID.



The legend should look like this

 _________________
 |        LEGEND       |
 |-----------------------------|
 |   -2-         John       |
 |   -3-         Michael  |
 |   -4-         Wolf       |
 |   -6-        Edward    |
 |   -7-       Shaun      |
  ------------------------------


Does anyone know how I can create such a mapping legend?
Is there any good command to do this?

I've tried using "replace" but this is not a good solution. because it 
replaces only 1 values.


Kind Regards, 

Edwin Sendjaja



More information about the R-help mailing list