Am 28.07.2010 07:36, schrieb jd6688:
> 
> DF1
> name  OTHER   
> ABC    O
> KKK    O
> QQQ    O
> DDD    O
> PPP    O
> 
> DF2
> name
> ABC
> KKK
> DDD
> 
> If the names in df1 mapped the names in df2, then add the mapped name to df1
> as a separate column, for instance "mappedColumn"

What do you mean by "mapped":
(1) how often a name in df1 is present or
(2) whether a name of DF1 is existing in DF2?

for (1) you could use DF1$existsinDF2<-DF1$name%in%DF2$name
for (2) use either aggregate or table (type ?aggregate or ?table at
command prompt for help.

Stefan

______________________________________________
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