Re: [Rd] question about trailing arguments in an S4 method

2006-12-16 Thread Byron Ellis
He wants to specify arguments to AIC that act like the "k" argument and is thinking of faking it by, essentially, doing another round of argument matching on ... I think that if you define an S4 generic that only dispatches on the first argument you may be able to do it for a specific method. On t

Re: [Rd] caching frequently used values

2006-12-16 Thread Gabor Grothendieck
See: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/83547.html On 12/13/06, Tamas K Papp <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to find an elegant way to compute and store some > frequently used matrices "on demand". The Matrix package already uses > something like this for storing de

Re: [Rd] question about trailing arguments in an S4 method

2006-12-16 Thread Seth Falcon
Ben Bolker <[EMAIL PROTECTED]> writes: > I'm trying to add arguments to the AIC method > for some classes -- things like > weights=TRUE to calculate AIC weights > corr=TRUE, nobs to calculate AICc > delta=TRUE to put a delta-AIC column in the output. > > The problem is that AIC is define

Re: [Rd] data frame subset patch, take 2

2006-12-16 Thread Martin Maechler
> "MM" == Martin Maechler <[EMAIL PROTECTED]> > on Sat, 16 Dec 2006 22:31:21 +0100 writes: > "Vladimir" == Vladimir Dergachev <[EMAIL PROTECTED]> > on Wed, 13 Dec 2006 13:03:21 -0500 writes: Vladimir> On Wednesday 13 December 2006 6:01 am, Martin Maechler wrote: >>

Re: [Rd] data frame subset patch, take 2

2006-12-16 Thread Martin Maechler
> "Vladimir" == Vladimir Dergachev <[EMAIL PROTECTED]> > on Wed, 13 Dec 2006 13:03:21 -0500 writes: Vladimir> On Wednesday 13 December 2006 6:01 am, Martin Maechler wrote: >> >> - Vladimir, have you verified your 'take2' against recent versions >> of R-devel? Vlad

Re: [Rd] question about trailing arguments in an S4 method

2006-12-16 Thread Prof Brian Ripley
I don't see how this can work, in S3 or S4. Callers of AIC are entitied to expect it to behave as described on the help page, and so to be able to pass objects called (e.g.) 'delta' and get back exactly the value mentioned. For what you seem to want to do, I think you need your own generic.

Re: [Rd] Curious finding in MASS:::confint.glm() tied to eval()

2006-12-16 Thread Peter Dalgaard
Marc Schwartz wrote: > Hi all, > > Has anyone had a chance to look at this and either validate my finding > or tell me that my brain has turned to mush? > > Either would be welcome... :-) > > Scoping issues can turn anyones brain to mush! This sort of thing easily happens with code ported from

[Rd] question about trailing arguments in an S4 method

2006-12-16 Thread Ben Bolker
I'm trying to add arguments to the AIC method for some classes -- things like weights=TRUE to calculate AIC weights corr=TRUE, nobs to calculate AICc delta=TRUE to put a delta-AIC column in the output. The problem is that AIC is defined as AIC(object, ..., k=2) where k is the constant

Re: [Rd] Curious finding in MASS:::confint.glm() tied to eval()

2006-12-16 Thread Marc Schwartz
Hi all, Has anyone had a chance to look at this and either validate my finding or tell me that my brain has turned to mush? Either would be welcome... :-) Thanks, Marc On Wed, 2006-12-13 at 13:53 -0600, Marc Schwartz wrote: > Greetings all, > > I was in the process of creating a function to

Re: [Rd] max.col oddity

2006-12-16 Thread Duncan Murdoch
On 12/16/2006 12:25 PM, John Zedlewski wrote: > Duncan-- > Ah, good point, clearly setting the tolerance to 0 is bad in that > case. Also, my code has another problem when the max is negative -- it > will set a negative tolerance! One good fix for both problems is the > following: set the initial

Re: [Rd] max.col oddity

2006-12-16 Thread John Zedlewski
Duncan-- Ah, good point, clearly setting the tolerance to 0 is bad in that case. Also, my code has another problem when the max is negative -- it will set a negative tolerance! One good fix for both problems is the following: set the initial value of "large" to the first value in the row instead o

Re: [Rd] co.intervals when overlap=0 or 0.5 (PR#9419)

2006-12-16 Thread ripley
Please don't report bugs that are already fixed in R-devel. On Sat, 16 Dec 2006, [EMAIL PROTECTED] wrote: > Full_Name: Benjamin Tyner > Version: 2.4.0 > OS: linux-gnu > Submission from: (NULL) (71.98.75.54) > > > As pointed out by Brian Ripley on R-devel, co.intervals does xr <- x[r + ii] > with

[Rd] co.intervals when overlap=0 or 0.5 (PR#9419)

2006-12-16 Thread btyner
Full_Name: Benjamin Tyner Version: 2.4.0 OS: linux-gnu Submission from: (NULL) (71.98.75.54) As pointed out by Brian Ripley on R-devel, co.intervals does xr <- x[r + ii] with a fractional r, leading to intervals that don't match the ones returned by S-PLUS when overlap=0 or 0.5. For example, x<-

Re: [Rd] max.col oddity

2006-12-16 Thread Duncan Murdoch
On 12/15/2006 7:09 PM, John Zedlewski wrote: > I've noticed that the max.col function with the default "random" > option often gives unexpected results. For instance, in this test, it > seems clear what the answer should be: > >> # second col should always be max >> x1 = cbind(1:10, 2:11, -Inf) >>