Dear R users,
I have a data frame with one column (4000 rows) containing name codes
(factor with 63 levels). I would like to  associate each name with a
particular Type (coded as 1,2,3,4,H or H1) in a second column. Is it
possible to do a lookup table of associations (i.e. A23 is of type 1, A13
is of type 3 ...) so as to fill up automatically the $Type column.

df()
$Source    $Type
A23
A24
A9
A32
A25
A14
A10
A12
A11
A13
G


Alternative solutions are also welcome.
Thanks in advance

P.S. I found a discussion mentioning match() and %in% but it does not seem
adapted.

-- 
Nikola Markov
Inserm U 846 Stem cells and brain research institute
18 av Du Doyen Lepine
69500 Bron
France

______________________________________________
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