[R] Merge function - Return NON matches

Sarah Goslee sarah.goslee at gmail.com
Thu Apr 26 22:29:20 CEST 2012


You'd get better help if you actually did as Steve requested and
provided sample data (a reproducible example!) using dput().

But since you didn't:

> fakedata <- data.frame(a = 1:5, b=11:15, c=c(1,1,1,2,2))
> fakedata
  a  b c
1 1 11 1
2 2 12 1
3 3 13 1
4 4 14 2
5 5 15 2
> notb <- c(12, 14, 15)
> subset(fakedata, !b %in% notb)
  a  b c
1 1 11 1
3 3 13 1

Since you say that doesn't work for you, you absolutely have to
provide us with a reproducible example for anyone to be able to
diagnose your problem.

Sarah

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.
>
> Any further help is most appreciated!
>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list