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

2020-09-15 Thread Dirk Eddelbuettel
On 15 September 2020 at 10:27, Cesko Voeten wrote: | the language provides an obvious way to do this, why write a semantic kludge As already said, Occam's Razor give the answer: keep it simple(r) and don't write the kludge. Stick it all into a package, load the package on every node and use the

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

2020-09-15 Thread Cesko Voeten
Henrik, I completely agree with everything you wrote, but note that the issue at hand is using `:::' in *the same* package, for example when a package needs to access its own internal functions from an outside context, where running on a cluster node set up by the package is one thing I can th

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

2020-09-14 Thread Henrik Bengtsson
Without having read all of the comments already made here, but my understanding why ::: is not allowed is because you are reaching into the internal API that the package owner does not guarantee will exist in the next release. If you rely on the internal code of another CRAN package in your CRAN p

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

2020-09-14 Thread David Kepplinger
Yes, my view is certainly rigid and I agree that in the cases where the function is actually used directly by the user, exporting it is the correct step. However, it seems some packages actually need to access internal functions from an outside context, but the code that accesses the function is l

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

2020-09-14 Thread Duncan Murdoch
Murdoch Sent: Monday, September 14, 2020 10:49 AM To: Wang, Zhu ; David Kepplinger ; R Package Devel Subject: Re: [R-pkg-devel] Use of `:::` in a package for code run in a parallel cluster On 14/09/2020 10:30 a.m., Wang, Zhu wrote: In mypkg, I want to call a function foo from pkg, and foo is

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

2020-09-14 Thread Wang, Zhu
: Wang, Zhu ; David Kepplinger ; R Package Devel Subject: Re: [R-pkg-devel] Use of `:::` in a package for code run in a parallel cluster On 14/09/2020 10:30 a.m., Wang, Zhu wrote: > In mypkg, I want to call a function foo from pkg, and foo is not exported. I > thought I should use pkg::

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

2020-09-14 Thread Duncan Murdoch
coming from a user script. -Original Message- From: Duncan Murdoch Sent: Monday, September 14, 2020 7:17 AM To: Wang, Zhu ; David Kepplinger ; R Package Devel Subject: Re: [R-pkg-devel] Use of `:::` in a package for code run in a parallel cluster On 13/09/2020 8:47 p.m., Wang, Zhu wr

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

2020-09-14 Thread Jeff Newmiller
ose if the call is >coming from a user script. > >-Original Message- >From: Duncan Murdoch >Sent: Monday, September 14, 2020 7:17 AM >To: Wang, Zhu ; David Kepplinger >; R Package Devel > >Subject: Re: [R-pkg-devel] Use of `:::` in a package for code run in a >para

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

2020-09-14 Thread Wang, Zhu
of those if the call is coming from a > user script. -Original Message- From: Duncan Murdoch Sent: Monday, September 14, 2020 7:17 AM To: Wang, Zhu ; David Kepplinger ; R Package Devel Subject: Re: [R-pkg-devel] Use of `:::` in a package for code run in a parallel cluster On 13/09

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

2020-09-14 Thread Duncan Murdoch
13, 2020 3:20 PM To: David Kepplinger ; R Package Devel Subject: Re: [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: Dear list members, I submitted an update for my package and got automatically rejected by the incoming

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

2020-09-14 Thread Georgi Boshnakov
You may have a case to argue to CRAN that you can get the "almost" exemption (can't say without details) but your views look overly rigid. Exporting an object and marking it as internal is not a "work around", even less a "dirty trick". Export makes the object available outside the package's na

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

2020-09-13 Thread Wang, Zhu
import not declared from: ‘pkg' I probably missed something here. Thanks, Zhu -Original Message- From: R-package-devel On Behalf Of Duncan Murdoch Sent: Sunday, September 13, 2020 3:20 PM To: David Kepplinger ; R Package Devel Subject: Re: [R-pkg-devel] Use of `:::` in a package fo

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

2020-09-13 Thread David Kepplinger
Thank you all for the discussion and suggestions. so making a package function baz available makes all functions in the > package available -- a function in the package already has access to other > functions in the namespace, whether those functions are exported or not, so > there is no need to u

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

2020-09-13 Thread Joshua Ulrich
On Sun, Sep 13, 2020 at 3:19 PM Duncan Murdoch wrote: > > On 13/09/2020 3:51 p.m., David Kepplinger wrote: > > Dear list members, > > > > I submitted an update for my package and got automatically rejected by the > > incoming checks (as expected from my own checks) for using `:::` calls to > > acc

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

2020-09-13 Thread Martin Morgan
At least in the 'parallel' package library(parallel) cl = makePSOCKcluster(2) and because of the nature of the R language, the entire namespace is exported, analogous to baz <- local({ foo <- function() 2 function(...) foo() }) so making a package function baz available makes all funct

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

2020-09-13 Thread Duncan Murdoch
On 13/09/2020 3:51 p.m., David Kepplinger wrote: Dear list members, I submitted an update for my package and got automatically rejected by the incoming checks (as expected from my own checks) for using `:::` calls to access the package's namespace. "There are ::: calls to the package's namespace