Skip to content
Prev 371416 / 398513 Next

help matching rows of a data frame

You could use merge() with an ID column pasted onto the table of names, as
in
Surname=c("Xavier","Yates","Yates","Yates","Zapf"), Id=paste0("P",101:105))
FirstName Surname   Id
1       Abe  Xavier P101
2       Abe   Yates P102
3       Bob   Yates P103
4     Chuck   Yates P104
5     Chuck    Zapf P105
Surname=rep("Yates",3)), tbl, all.x=TRUE)
  FirstName Surname   Id
1       Abe   Yates P102
2     Chuck   Yates P104
3      Dave   Yates <NA>


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Mon, Sep 18, 2017 at 5:13 AM, Therneau, Terry M., Ph.D. <
therneau at mayo.edu> wrote: