Skip to content

match and incomparables

4 messages · McGehee, Robert, Adam D. I. Kramer, Bert Gunter +1 more

#
Hello,
I was playing around with the newly implemented 'incomparables' argument
in 'match' and realized the argument does not behave anything like I
expected. Can someone explain what is going on here? Sorry if I'm
misreading the documentation.
[1] NA  2  3  # This seems right, the 1 in 'x' is 'incomparable'
[1] 1  2  3   # Shouldn't this be 1 NA 3? Why isn't the 2 incomparable?
[1] NA  2  3   # Why isn't the 5 ignored?

Note from ?match:
"incomparables: a vector of values that cannot be matched. Any value in
x matching a value in this vector is assigned the nomatch value. For
historical reasons, FALSE is equivalent to NULL."

Thanks in advance!
Robert

platform       i386-pc-mingw32             
arch           i386                        
os             mingw32                     
system         i386, mingw32               
status                                     
major          2                           
minor          7.2                         
year           2008                        
month          08                          
day            25                          
svn rev        46428                       
language       R                           
version.string R version 2.7.2 (2008-08-25)

Robert McGehee, CFA
Geode Capital Management, LLC
One Post Office Square, 28th Floor | Boston, MA | 02109
Tel: 617/392-8396    Fax:617/476-6389
mailto:robert.mcgehee at geodecapital.com



This e-mail, and any attachments hereto, are intended fo...{{dropped:12}}
#
I can replicate this and also do not understand it.
[1] NA  2  3
[1] 1 2 3
[1] 1 2 3
[1] 1 2 3
[1] NA  2  3

...every other integer value for incomparables produces 1 2 and 3 for
output. I'm using R 2.7.2, self-compiled, under linux.

--Adam
On Fri, 12 Sep 2008, McGehee, Robert wrote:

            
#
Looks like a bug to me. Compare:
[1] 1 2 3
[1] 1 2 3
[1] NA NA  3
[1] NA  2  3

Cheers,
Bert


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Adam D. I. Kramer
Sent: Friday, September 12, 2008 3:06 PM
To: McGehee, Robert
Cc: r-help
Subject: Re: [R] match and incomparables

I can replicate this and also do not understand it.
[1] NA  2  3
[1] 1 2 3
[1] 1 2 3
[1] 1 2 3
[1] NA  2  3

...every other integer value for incomparables produces 1 2 and 3 for
output. I'm using R 2.7.2, self-compiled, under linux.

--Adam
On Fri, 12 Sep 2008, McGehee, Robert wrote:

            
http://www.R-project.org/posting-guide.html
______________________________________________
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.
#
On Fri, 12 Sep 2008, Bert Gunter wrote:

            
A bug fixed in the R-devel version of R (because of a related problem with 
duplicated).