From h.wickham at gmail.com  Wed Mar 20 16:23:34 2013
From: h.wickham at gmail.com (Hadley Wickham)
Date: Wed, 20 Mar 2013 10:23:34 -0500
Subject: [Rd] Deprecating partial matching in $.data.frame
In-Reply-To: <A0DE2631-213D-4DB2-A952-5DBFA7A7F14C@gmail.com>
References: <A0DE2631-213D-4DB2-A952-5DBFA7A7F14C@gmail.com>
Message-ID: <CABdHhvEb6cg2Jtgmoor-H8-YHpoEK=RJSnDH6kN7kE46yxmF6g@mail.gmail.com>

On Wed, Mar 20, 2013 at 7:28 AM, peter dalgaard <pdalgd at gmail.com> wrote:
> Allowing partial matching on $-extraction has always been a source of accidents. Recently, someone who shall remain nameless tried names(mydata) <- "d^2" followed by mydata$d^2.
>
> As variables in a data frame are generally considered similar to variables in, say, the global environment, it seems strange that foo$bar can give you the content of foo$bartender.
>
> In R-devel (i.e., *not* R-3.0.0 beta, but 3.1.0-to-be) partial matches now gives a warning.

Just for data frames, or also for lists?

I think this is a fantastic change, but I do worry a little that it is
going to generate warnings for a _lot_ of existing code.

Hadley

-- 
Chief Scientist, RStudio
http://had.co.nz/



[Rd] Deprecating partial matching in $.data.frame
Hadley Wickham