Skip to content

Strange case of partial matching in .[ - possible bug / wrong documentation?

4 messages · Duncan Murdoch, David Winsemius, Hilmar Berger

#
On 19/05/2010 12:14 PM, Hilmar Berger wrote:
See near the top of the page:  "The descriptions here apply only to the 
default methods."  Since indexing is generic, an extraction method can 
do whatever it wants, and you need to read the particular page to find 
the behaviour.  The page for Extract.data.frame says:

"Both |[| and |[[| extraction methods partially match row names. By 
default neither partially match column names, but |[[| will unless 
|exact=TRUE|. If you want to do exact matching on row names use |match 
<http://127.0.0.1:28754/library/base/help/match>| as in the examples."

Duncan Murdoch
#
On May 19, 2010, at 12:14 PM, Hilmar Berger wrote:

            
That was for [.matrix or similar  (as noted at top of the page). You  
created a different class of variable.

?"[.data.frame

"Both [ and [[ extraction methods partially match row names. By  
default neither partially match column names, but [[ will unless  
exact=TRUE. If you want to do exact matching on row names use match as  
in the examples."
#
Duncan Murdoch schrieb:
Sorry, I should have read the complete help page.

Thanks a lot !

Best regards,
Hilmar