[R] Partial matching when using $ ? Feature or bug?

Sarah Goslee sarah.goslee at gmail.com
Fri Mar 16 15:05:43 CET 2012


>> It's also a really good reason to use [[ in functions or anywhere there might be a chance of
>> confusion.
>
> Absolutely - I think I have to change my habit. I always prefered using $ as it seemed to me more
> logical.

I started out that way because it's shorter and nicer-looking code,
but it can cause partial-matching problems, and also LaTeX annoyances
in Sweave code. Someday I'll go back through my packages and get rid
of all the lingering $.

R: lots of ways to do the same thing, but some of them are booby-trapped.

Sarah

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



More information about the R-help mailing list