Re: [Rd] Problem with defining new method for residuals()

2011-03-11 Thread ONKELINX, Thierry
Dear Martin, Thank you very much for your solution. It works fine. Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen

[Rd] Using missing() in a S4 method with extra arguments

2011-03-11 Thread Andreas Borg
Hi all, I have a function which makes use of missing() to determine which arguments are provided in the call - basically, there are two sets of arguments that map to different strategies the function uses to fulfill its task. After conversion to an S4 generic I've run into the problem that

Re: [Rd] Using missing() in a S4 method with extra arguments

2011-03-11 Thread Martin Morgan
On 03/11/2011 02:07 AM, Andreas Borg wrote: Hi all, I have a function which makes use of missing() to determine which arguments are provided in the call - basically, there are two sets of arguments that map to different strategies the function uses to fulfill its task. After conversion to

Re: [Rd] Using missing() in a S4 method with extra arguments

2011-03-11 Thread Andreas Borg
Hi Martin, in the real function, I am not dispatching on the argument for which I test missingness, but it might be a good idea to do so - this way I could make the function tidier by relocating different branches to seperate methods. Thanks for the suggestion! Andreas if you're testing

[Rd] hook for when R quits

2011-03-11 Thread Michael Lawrence
Hi, Is there any way that a package can listen for when R quits? The Qt stuff is hooking into platform-specific event loops and when those die unexpectedly (from the perspective of Qt), it aborts, causing an annoying error dialog. If we could catch when R is killed, we could cleanup, like we do

Re: [Rd] hook for when R quits

2011-03-11 Thread Jeffrey Ryan
Take a look at reg.finalizer. You'd have to create an object internally that would persist until R exits - and a related function to handle cleanup of course. HTH Jeff On Fri, Mar 11, 2011 at 12:08 PM, Michael Lawrence lawrence.mich...@gene.com wrote: Hi, Is there any way that a package can

Re: [Rd] hook for when R quits

2011-03-11 Thread Michael Lawrence
Thanks for the suggestion, but I don't think that R finalizes all of its objects when it quits. At least a simple test suggests that on Linux. Michael On Fri, Mar 11, 2011 at 10:19 AM, Jeffrey Ryan jeffrey.r...@lemnica.comwrote: Take a look at reg.finalizer. You'd have to create an object

Re: [Rd] hook for when R quits

2011-03-11 Thread Henrik Bengtsson
See onSessionExit() in the R.utils package, e.g. onSessionExit(function(...) { cat(Bye bye world!\n); }) quit(); Please pay attention to the Details section of help(onSessionExit); there are ways that R can exit that will not be detected/handled. /Henrik On Fri, Mar 11, 2011 at 10:37 AM,

Re: [Rd] hook for when R quits

2011-03-11 Thread Duncan Murdoch
On 11/03/2011 1:37 PM, Michael Lawrence wrote: Thanks for the suggestion, but I don't think that R finalizes all of its objects when it quits. At least a simple test suggests that on Linux. Did you use onexit=TRUE? On Windows that appears to work... Duncan Murdoch Michael On Fri, Mar 11,

Re: [Rd] hook for when R quits

2011-03-11 Thread Prof Brian Ripley
On Fri, 11 Mar 2011, Duncan Murdoch wrote: On 11/03/2011 1:37 PM, Michael Lawrence wrote: Thanks for the suggestion, but I don't think that R finalizes all of its objects when it quits. At least a simple test suggests that on Linux. Did you use onexit=TRUE? On Windows that appears to

Re: [Rd] hook for when R quits

2011-03-11 Thread Henrik Bengtsson
On Fri, Mar 11, 2011 at 11:07 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Fri, 11 Mar 2011, Duncan Murdoch wrote: On 11/03/2011 1:37 PM, Michael Lawrence wrote: Thanks for the suggestion, but I don't think that R finalizes all of its objects when it quits. At least a simple test

[Rd] WARNING Undocumented S4 methods 'initialize' - why?

2011-03-11 Thread cstrato
Dear all, I am just writing the documentation file for S4 class 'QualTreeSet' and get the following warning with R CMD check: * checking for missing documentation entries ... WARNING Undocumented S4 methods: generic 'initialize' and siglist 'QualTreeSet' All user-level objects in a package

Re: [Rd] hook for when R quits

2011-03-11 Thread Duncan Murdoch
On 11/03/2011 3:11 PM, Henrik Bengtsson wrote: On Fri, Mar 11, 2011 at 11:07 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Fri, 11 Mar 2011, Duncan Murdoch wrote: On 11/03/2011 1:37 PM, Michael Lawrence wrote: Thanks for the suggestion, but I don't think that R finalizes all of