[R] Merge function - Return NON matches

Steve Lianoglou mailinglist.honeypot at gmail.com
Thu Apr 26 22:37:49 CEST 2012


Hi,

As Sarah reiterated -- it'd *really* be helpful if you give us data we
can actually work with.

That having been said:

On Thu, Apr 26, 2012 at 4:12 PM, RHelpPlease <rrumple at trghcsolutions.com> wrote:
> Hi again,
> I tried the sample code like this:
>
>> merged_clmno <- subset(bestPartAreadmin, !CLAIM_NO %in% hrc78_clm_no)
>> dim(merged_clmno)
> [1] 13068    93
>
> Note that:
>> dim(bestPartAreadmin)
> [1] 13068    93
>
> So, no change between the original data.frame (bestPartAreadmin) & the
> (should be) less-rows merged_clmno data.frame.

You're original email said you had a "list" that contains CLAIM_NO's
you want to exclude.

Is `hrc78_clm_no` this "list" -- does it only have claim_no's? passing
a list into the subset call after `%in%` won't work.

If you do `no <- unlist(hrc_78_clm_no`, do you get a character vector
of claim numbers you want to exclude? If so, then `subset(whatever,
!CLAIM_NO %in% no)` should work.

HTH,
-steve


>
> Any further help is most appreciated!
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Merge-function-Return-NON-matches-tp4590755p4590851.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