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

Gabor Grothendieck ggrothendieck at gmail.com
Sat Apr 12 20:59:02 CEST 2008


See
?merge
?match
for two different ways and do an RSiteSearch for those
to find examples in the archives

On Sat, Apr 12, 2008 at 12:19 AM, Edwin Sendjaja <edwin7 at web.de> wrote:
> 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
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list