Re: [Rd] naresid.exclude query

2011-01-19 Thread Prof Brian Ripley
There was a reason for that line, as running 'make check' with your modification would have shown you. Sometimes naresid() is called with x=NULL. AFAICS replacing the test with is.null(x) suffices, and I'm testing that in R-devel. If nothing else comes up I will port it to R-patched later.

Re: [Rd] formula(model.frame(y~.^2, data=d)) does not return formula from terms attribute of the model.frame

2011-01-19 Thread Prof Brian Ripley
On Thu, 6 Jan 2011, William Dunlap wrote: In R 2.12.0 I get > d <- data.frame(x=1:10, y=log(1:10), f3=LETTERS[rep(1:3,c(3,3,4))]) > m <- model.frame(y~.^2, data=d) > formula(m) y ~ x + f3 In S+ formula(m) gives formula given to model.frame(), but in R you have to do the following get that fo

[Rd] buglet in weighted.residuals(mlmObject)

2011-01-19 Thread William Dunlap
When weighted.residuals() is given a fitted model object with several responses (class mlm) and some zero weights it returns a vector instead of a matrix. It looks like it is doing resids[ weights != 0 ] instead of resids[ weights != 0, , drop=FALSE] in the multi-response case. E.g., > d4

Re: [Rd] formula(model.frame(y~.^2, data=d)) does not return formula from terms attribute of the model.frame

2011-01-19 Thread William Dunlap
It is not terribly important, but I had a model.frame which I forgot was a model.frame and was surprised that lm(modelFrame) gave me a result based on the different formula than formula(modelFrame) showed. S+'s formula() makes those consistent (and it also makes model.frame's output have cla

Re: [Rd] buglet in weighted.residuals(mlmObject)

2011-01-19 Thread Prof Brian Ripley
Thanks: changed in R-patched. On Wed, 19 Jan 2011, William Dunlap wrote: When weighted.residuals() is given a fitted model object with several responses (class mlm) and some zero weights it returns a vector instead of a matrix. It looks like it is doing resids[ weights != 0 ] instead of res