[R] Merge function - Return NON matches

Steve Lianoglou mailinglist.honeypot at gmail.com
Thu Apr 26 21:41:55 CEST 2012


Hi,

To increase the chances of you getting help on this one, please give
example data (a small data.frame, a small list) that you are trying to
do this on, and also show the desired output. Whip these variables up
in your R workspace and paste the output of `dput` for each into your
follow up email.

It's hard (for me, anyways) to get what you're after ... I'm guessing
something that ends up looking like this will end up being one
solution:

subset(your.df, !CLAIM_NO %in% `something`)

but it's hard for me to tell from where I'm setting.

-steve


On Thu, Apr 26, 2012 at 3:33 PM, RHelpPlease <rrumple at trghcsolutions.com> wrote:
> Hi there,
> I wish to merge a common variable between a list and a data.frame & return
> rows via the data.frame where there is NO match.  Here are some details:
>
> The list, where the variable/col.name = CLAIM_NO
> CLAIM_NO
> 20
> 83
> 1440
> 4439
> 7002
> ...
>
>> dim(hrc78_clm_no)
> [1] 6678    1
>
> The data.frame, where there exists a variable with the same name, CLAIM_NO.
>> dim(bestPartAreadmin)
> [1] 13068    93
>
> I wish to merge the two together & only return a data.frame where there is
> NO match in the CLAIM_NO between both files.
>
> I've read & tried code via the "merge" function.  If "merge" can do this,
> I'm missing something with the available options.
>
> I'm figuring something like:
>
> clm_no_nomatch <- merge(hrc78_clm_no, bestPartAreadmin, by = "CLAIM_NO",  ..
> .. ..)
>
> Your help is most appreciated!
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Merge-function-Return-NON-matches-tp4590755p4590755.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.



-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list