Re: [R-pkg-devel] active bindings in package namespace

2019-03-25 Thread Ralf Stubner
On 24.03.19 18:27, Jack O. Wasey wrote: > This is a good point. I would prefer to include all the data in the > package, but CRAN has strict limitations on package and subdirectory > size, which the potential data would easily exceed. You could use a separate data package distributed via drat, c.f

Re: [R-pkg-devel] active bindings in package namespace

2019-03-24 Thread Jack O. Wasey
9 9:57 AM To: Kirill Müller ; R Development Subject: Re: [R-pkg-devel] active bindings in package namespace Thanks both, this is helpful advice. On 3/23/19 5:14 PM, Kirill Müller wrote: Dear Jack This doesn't answer your question, but I would advise against this design. - Users do not exp

Re: [R-pkg-devel] active bindings in package namespace

2019-03-24 Thread Hong Ooi via R-package-devel
9 9:57 AM To: Kirill Müller ; R Development Subject: Re: [R-pkg-devel] active bindings in package namespace Thanks both, this is helpful advice. On 3/23/19 5:14 PM, Kirill Müller wrote: > Dear Jack > > > This doesn't answer your question, but I would advise against this design. &g

Re: [R-pkg-devel] active bindings in package namespace

2019-03-23 Thread Jack Wasey
Thanks both, this is helpful advice. On 3/23/19 5:14 PM, Kirill Müller wrote: > Dear Jack > > > This doesn't answer your question, but I would advise against this design. > > - Users do not expect side effects (such as network access) from accessing a > symbol. > > - A function gives you much

Re: [R-pkg-devel] active bindings in package namespace

2019-03-23 Thread Kirill Müller
Dear Jack This doesn't answer your question, but I would advise against this design. - Users do not expect side effects (such as network access) from accessing a symbol. - A function gives you much more flexibility to change the interface later on. (Arguments for fetching the data, tokens f

Re: [R-pkg-devel] active bindings in package namespace

2019-03-23 Thread Gábor Csárdi
On Sat, Mar 23, 2019 at 9:46 PM Jack Wasey wrote: > > Thanks for that thought. I do also do this in that package, and the same > problem exists, since the code in those particular steps of R CMD check also > calls .onLoad. These steps might even attach the package: the R CMD check > code in too

Re: [R-pkg-devel] active bindings in package namespace

2019-03-23 Thread Jack Wasey
Thanks for that thought. I do also do this in that package, and the same problem exists, since the code in those particular steps of R CMD check also calls .onLoad. These steps might even attach the package: the R CMD check code in tools is too convoluted for me to unravel, but the result is the

Re: [R-pkg-devel] active bindings in package namespace

2019-03-23 Thread Gábor Csárdi
Hi, yet another workaround is to create the active binding in the .onLoad() function. Here is an example from the cli package: https://github.com/r-lib/cli/blob/d4756c483f69c2382c27b0b983d0ce7cc7e63763/R/onload.R#L8 Gabor On Sat, Mar 23, 2019 at 3:50 PM Jack O. Wasey wrote: > > Dear all, > > I a

[R-pkg-devel] active bindings in package namespace

2019-03-23 Thread Jack O. Wasey
Dear all, I am developing a package which is a front for various online data (icd.data https://github.com/jackwasey/icd.data/ ). The current CRAN version just has lazy-loaded data, but now the package encompasses far more current and historic ICD codes from different countries, these can't be