[R] Basic question about: <<- and method start with dot.

Fabrice Tourre fabrice.ciup at gmail.com
Tue Oct 2 18:13:53 CEST 2012


require("fortunes")
Loading required package: fortunes
>fortune("<<-")

I wish <<- had never been invented, as it makes an esoteric and dangerous
feature of the language *seem* normal and reasonable. If you want to dumb down
R/S into a macro language, this is the operator for you.
   -- Bill Venables
      R-help (July 2001)

On Tue, Oct 2, 2012 at 11:14 AM, peter dalgaard <pdalgd at gmail.com> wrote:
>
> On Oct 2, 2012, at 13:35 , Hadley Wickham wrote:
>
>>>> What is the special meaning for the method name start with a dot?
>>>
>>> It means nothing in particular, except that such objects don't show up in ls() by default. The _intention_ is usually that the function is only to be used internally and not for end-user use.
>>
>> But these days, if you're writing a package, you're better off using namespaces.
>
> Sure, but that doesn't keep package writers from using that kind of naming convention for non-exported objects. (Notice that this started as a question about reading 3rd party source codes.)
>
> --
> Peter Dalgaard, Professor
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com
>




More information about the R-help mailing list