Re: [R] Merge function - Return NON matches

2012-04-27 Thread RHelpPlease
Hi again, Petr, your solution worked! Thanks everyone for your input. I'll look more into "setdiff." Cheers! -- View this message in context: http://r.789695.n4.nabble.com/Merge-function-Return-NON-matches-tp4590755p4593101.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Merge function - Return NON matches

2012-04-27 Thread Petr PIKAL
Hi If you used shorter names for your objects you will get probably more readable advice Is this what you wanted? truncated_dataframe[truncated_dataframe$CLAIM_NO %in% setdiff(truncated_dataframe$CLAIM_NO, truncated_list$CLAIM_NO),] Regards Petr > Hi there, > I've tried the noted solutions

Re: [R] Merge function - Return NON matches

2012-04-27 Thread RHelpPlease
Hi there, I've tried the noted solutions: "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." I converted the CLAIM_NO list to a character, with > hrc78_clmno_char <- format

Re: [R] Merge function - Return NON matches

2012-04-26 Thread chuck.01
# dput() example # lets say you have data called y, like this: > y sp1 sp2 sp3 sp4 d 0 0 0 0 e 0 0 0 0 f 0 0 0 0 # ok, so do this: > dput(y) structure(list(sp1 = c(0, 0, 0), sp2 = c(0, 0, 0), sp3 = c(0, 0, 0), sp4 = c(0, 0, 0)), .Names = c("sp1", "sp2", "sp3", "sp4" )

Re: [R] Merge function - Return NON matches

2012-04-26 Thread MacQueen, Don
Assuming everything else is good, the "all" or "all.x" or "all.y" arguments to merge() should do what I think you're asking for. You did read the help page for merge, right? -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 O

Re: [R] Merge function - Return NON matches

2012-04-26 Thread RHelpPlease
Hi there, Thanks for your responses. I haven't used/heard of dput() before. I'm looking it up & understanding how it works. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/Merge-function-Return-NON-matches-tp4590755p4591003.html Sent from the R help mailing list archive

Re: [R] Merge function - Return NON matches

2012-04-26 Thread Steve Lianoglou
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 wrote: > Hi again, > I tried the sample code like this: > >> merged_clmno <- subset(bestPartAreadmin, !CLAIM_NO %in% hrc78_clm_n

Re: [R] Merge function - Return NON matches

2012-04-26 Thread Sarah Goslee
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) >

Re: [R] Merge function - Return NON matches

2012-04-26 Thread RHelpPlease
Hi again, I tried the sample code like this: > merged_clmno <- subset(bestPartAreadmin, !CLAIM_NO %in% hrc78_clm_no) > dim(merged_clmno) [1] 1306893 Note that: > dim(bestPartAreadmin) [1] 1306893 So, no change between the original data.frame (bestPartAreadmin) & the (should be) less-row

Re: [R] Merge function - Return NON matches

2012-04-26 Thread RHelpPlease
Hi Steve, Thanks for replying. Here's a small piece of the data.frame: > bestPartAreadmin[1:5,1:6] DESY_SORT_KEY PRVDR_NUM CLM_THRU_DT CLAIM_NO NCH_NEAR_LINE_REC_IDEN_CD NCH_CLM_TYPE_CD 1 10193 290003 20090323 20

Re: [R] Merge function - Return NON matches

2012-04-26 Thread Steve Lianoglou
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 emai

[R] Merge function - Return NON matches

2012-04-26 Thread RHelpPlease
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] 66781 The data.frame, where