Skip to content

quick matching question

4 messages · Ben Ganzfried, Sarah Goslee, Marc Schwartz

#
Looks like a job for merge().
On Fri, Oct 28, 2011 at 10:49 AM, Ben Ganzfried <ben.ganzfried at gmail.com> wrote:

  
    
#
On Oct 28, 2011, at 9:49 AM, Ben Ganzfried wrote:

            
See ?merge and then use something like:

  newDF <- merge(Input_File_2, Input_File_1, by.x = "Barcode", by.y = "bcr_patient_barcode")

Also, pay attention to the 'all', 'all.x' and 'all.y' arguments, which control whether or not only matching records are retained or non-matching records are retained from one or both datasets. merge() performs an "SQL-like" join operation.

HTH,

Marc Schwartz