[ESS] Does R fix() or edit() work for you these days?]

Martin Maechler maechler at stat.math.ethz.ch
Tue Sep 11 11:29:39 CEST 2007


>>>>> "KDH" == Kasper Daniel Hansen <khansen at stat.berkeley.edu>
>>>>>     on Mon, 10 Sep 2007 10:25:18 -0700 writes:

    KDH> On Sep 10, 2007, at 9:23 AM, 8rino-Luca Pantani wrote:

[.............]

    >> BTW Which are your favourite way of naming objects ?  In
    >> other words, for a dataframe, do you prefer
    >> df.foo. foo.df, (plain)foo or what else ?  Are there some
    >> rules to avoid/reduce error in working with XEmacs/ ESS/R
    >> ?  I mean rules such as naming objects in dataframe
    >> always in maiuscule, vectors always in minuscule and
    >> things like that.

    KDH> There are no such rules. 
Yes, and I don't think it's a good ideas that some people want
to impose such rules.

    KDH> The only approximate rule
    KDH> which many people kind of uses is that names with "."
    KDH> in them refers to S3-methods/ objects/classes and names
    KDH> with camelCase like dataFrame refers to S4
    KDH> methods/objects/classes/

yes.

OTOH, 8rino asks about "your favorite way"  which is much less
stringent than "rules" and rather a matter of preferences.

My personal taste / opinion is to *not* use long variable names,
and I do work with "." here, where other people would prefer
other letters/styles.
E.g., I typicall call most of my data frames  
  'd.<topic>'
and then, the models I fit to this data, something like
  'lm1.<topic>'
  'lm2.<topic>'
  'glm1.<topic>'
etc; but all this depends on the circumstances and I'd always
"allow myself" to differ from such a scheme whenever I see
reasons.

One good reason for the above scheme is that you want names that
differ rather in the beginning than in the end, so
 <topic><subtopic>model1
 <topic><subtopic>model2
 <topic><subtopic>model3
seems less sensible to me -- both for reading and for writing
such code.

Martin




More information about the ESS-help mailing list