Re: [R-pkg-devel] Is there a better way ...?

2021-10-20 Thread Andrew Simmons
I think the simplest answer is to store the variable in the functions frame. I'm assuming here that the only plot.foo needs access to .fooInfo, if not this can be changed. plot.foo <- function (...) { .fooInfo } environment(plot.foo) <- new.env() evalq({ .fooInfo <- NULL },

Re: [R-pkg-devel] Is there a better way ...?

2021-10-20 Thread Deepayan Sarkar
On Thu, Oct 21, 2021 at 9:59 AM Rolf Turner wrote: > > > I have a plot method (say plot.foo()) that I want to be able to call so > that if argument "add" is set equal to TRUE, then further structure will > be added to the same plot. This is to be used *only* in the context in > which the plot

[R-pkg-devel] Is there a better way ...?

2021-10-20 Thread Rolf Turner
I have a plot method (say plot.foo()) that I want to be able to call so that if argument "add" is set equal to TRUE, then further structure will be added to the same plot. This is to be used *only* in the context in which the plot being added to was created using plot.foo(). [Please don't ask

[R-pkg-devel] CRAN Mac Builder based on M1

2021-10-20 Thread Simon Urbanek
Dear Mac useRs. I'm pleased to announce that thanks to the R Foundation and donations from users like you we are now able to offer a CRAN Mac Builder based on M1 hardware which allows package authors that don't have access to a recent Mac to check their package using the same process as

Re: [R-pkg-devel] How does one install a libtool generated libfoo.so.1 file into ./libs/?

2021-10-20 Thread Simon Urbanek
Pariksheet, dynamic linking won't work, compile a static version with PIC enabled. If the subproject is autoconf-compatible this means using --disable-shared --with-pic. Then you only need to add libfoo.a to your PKG_LIBS. Cheers, Simon > On Oct 19, 2021, at 4:13 PM, Pariksheet Nanda >

Re: [R-pkg-devel] Concise Summary For Any Variety Of R Function

2021-10-20 Thread Simon Urbanek
Dario, there is not such thing as S4 function. However, all functions have an environment and for functions from packages that environment will be the namespace of the package. So in those special cases you can use environmentName() to get the name, e.g.: > who = function(f)

Re: [R-pkg-devel] failing S3 dispatch

2021-10-20 Thread Jens Oehlschlägel
Thank you Duncan, bit NAMESPACE has S3method(clone,default) export(clone) ff NAMESPACE has import(bit) # wish of CRAN maintainers: export another time here (now maintained and exported in bit) # without this R CMD CHECK complained, but with it R CMD CHECK complains also, how to export again

Re: [R-pkg-devel] failing S3 dispatch

2021-10-20 Thread Duncan Murdoch
On 19/10/2021 3:43 p.m., Jens Oehlschlägel wrote: I didn't find an answer elsewhere: My package 'bit' creates a S3 generic 'clone' and exports it. Furthermore it registers a S3 method 'clone.default' (not exported). My package 'ff' imports package 'bit' and exports and registers a new S3