Skip to content
Prev 6009 / 12125 Next

[R-pkg-devel] Use of `:::` in a package for code run in a parallel cluster

On 13/09/2020 3:51 p.m., David Kepplinger wrote:
Who is calling this function:  package code or user code?  I assume it's 
a bit of a mix:  your package writes a script that calls the function 
when it runs in user space.  (It would help if you gave an explicit 
example of when you need to use this technique.)

If my assumption is correct, there are other simple workarounds besides 
exporting the functions.  Instead of putting

    pkg:::foo(args)

into your script, put

    pkg::callInternal("foo", args)

where pkg::callInternal is an exported function that can look up 
unexported functions in the namespace.

You may argue that you prefer pkg:::foo for some reason:  to which I'd 
respond that you are being rude to the CRAN volunteers.  I've offered 
two options (one in the previous thread, a different one here), and 
there was a third one in that thread offered by Ivan Krylov.  Surely one 
of these is good enough for your needs, and you shouldn't force CRAN to 
handle you specially.

Duncan

Thread (17 messages)