[R] Double-banger function names: preferences and suggestions
Joerg van den Hoff
j.van_den_hoff at fzd.de
Fri Mar 2 16:01:19 CET 2007
On Thu, Mar 01, 2007 at 10:31:08AM -0700, Jason Barnhart wrote:
> Definitely not #2. Prefer #1 but #3 is ok as well.
Definitely not #1. Prefer #2 but #3 is ok as well.
there is nothing like unanimous agreement :-)
but in earnest: I don't think #1 is good on the already mentioned grounds
that it masks the difference between a method call and a simple function name.
I don't think a function name such as
plot.mydata
would be reasonable: is this a method call for plotting objects of class
`mdyata' or is it some other function call (probably plotting my data)?
in browsing through source code this is at least an unnecessary nuisance
having to check this point.
>
> Thanks for contributing and inquiring.
>
>
> ----- Original Message -----
> From: "hadley wickham" <h.wickham at gmail.com>
> To: <R-help at r-project.org>
> Sent: Sunday, February 25, 2007 7:44 AM
> Subject: [R] Double-banger function names: preferences and suggestions
>
>
> > What do you prefer/recommend for double-banger function names:
> >
> > 1 scale.colour
> > 2 scale_colour
> > 3 scaleColour
> >
> > 1 is more R-like, but conflicts with S3. 2 is a modern version of
> > number 1, but not many packages use it. Number 3 is more java-like.
> > (I like number 2 best)
> >
> > Any suggestions?
> >
> > Thanks,
> >
> > Hadley
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list