about .function

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

about .function

Bogdan Tanasa
Dear all,

if I may ask please a very simple question :

what does "." mean in front of  function name : an example below . thank
you very much !

.set_pbmc_color_11<-function() {
  myColors <- c( "dodgerblue2",
                 "green4",
                 "#6A3D9A", # purple
                 "grey",
                 "tan4",
                 "yellow",
                 "#FF7F00", # orange
                 "black",
                 "#FB9A99", # pink
                 "orchid",
                 "red")

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: about .function

Duncan Murdoch-2
On 30/01/2020 1:38 p.m., Bogdan Tanasa wrote:

> Dear all,
>
> if I may ask please a very simple question :
>
> what does "." mean in front of  function name : an example below . thank
> you very much !
>
> .set_pbmc_color_11<-function() {
>    myColors <- c( "dodgerblue2",
>                   "green4",
>                   "#6A3D9A", # purple
>                   "grey",
>                   "tan4",
>                   "yellow",
>                   "#FF7F00", # orange
>                   "black",
>                   "#FB9A99", # pink
>                   "orchid",
>                   "red")
>

It means that the default ls() won't list the function, you'd need
ls(all.names = TRUE).  By convention such functions are usually meant
for internal use, but there are lots of exceptions to that convention.
The same convention is used in Unix-alike file systems.

Duncan Murdoch

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: about .function

Bogdan Tanasa
appreciate it ! thank you Duncan !

On Thu, Jan 30, 2020 at 11:18 AM Duncan Murdoch <[hidden email]>
wrote:

> On 30/01/2020 1:38 p.m., Bogdan Tanasa wrote:
> > Dear all,
> >
> > if I may ask please a very simple question :
> >
> > what does "." mean in front of  function name : an example below . thank
> > you very much !
> >
> > .set_pbmc_color_11<-function() {
> >    myColors <- c( "dodgerblue2",
> >                   "green4",
> >                   "#6A3D9A", # purple
> >                   "grey",
> >                   "tan4",
> >                   "yellow",
> >                   "#FF7F00", # orange
> >                   "black",
> >                   "#FB9A99", # pink
> >                   "orchid",
> >                   "red")
> >
>
> It means that the default ls() won't list the function, you'd need
> ls(all.names = TRUE).  By convention such functions are usually meant
> for internal use, but there are lots of exceptions to that convention.
> The same convention is used in Unix-alike file systems.
>
> Duncan Murdoch
>
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.