Skip to content

R annoyances

2 messages · Taylor, Z Todd, Duncan Murdoch

#
On Friday, May 20, 2005 11:29 AM, Jari Oksanen wrote:

            
BecauseIt'sFridayI'llJoinIntoThisTiredOldDebate.TheUseOfMixedCase
UglinessToDistinguishBetween"Words"InObjectNamesIsIndeedAn
Abomination.

It_is_much_easier,_and_demonstrably_so_I_would_say,_to_use
some_kind_of_real_separator_between_"words."

S.and.R.have.historically.encouraged.a.different.separator
than.most.other.languages,.but.the.principle.is.the.same.

And the double benefit is that it leaves case available for
other good uses, such as indicating an object's scope:

    local.var
    Class.Data
    GLOBAL.SETTING

--Todd
#
Taylor, Z Todd wrote:
Using an underscore will break old versions of R, and some versions of 
S-PLUS.

Using a dot will break S3 method dispatch.

Using mixed case will lead to complaints from people who don't mind 
breaking one of those things.

What's a package author to do??

I suggest that we redefine "+" to be a legal character in the name of an 
identifier.  Sure, if you used to have "a+b" you'll have to rewrite it 
as "+(a,b)", but think of the benefits! 
You+can+write+out+long+sentences+and+use+them+as+variable+names!

Duncan Murdoch