Skip to content
Prev 11144 / 12125 Next

[R-pkg-devel] Getting summary.glm to use Matrix::chol2inv

I think the only way to do this is to write your own summary.* method 
for your objects.  You should modify their class (e.g. to `c("glm2", 
"glm")` so that your new summary method `summary.glm2` is called instead 
of `summary.glm`.

Changing the search path wouldn't work.  Search order from within a 
package looks at locals, then imports, then the base package (where 
chol2inv would be found), then the search list.

The source for the standard summary.glm function is available, e.g. 
here: 
https://github.com/wch/r-source/blob/cfda9838f261b1c77c5ac6a5b0deed88021a2156/src/library/stats/R/glm.R#L687-L773 
.  You can copy that into your package, then modify it to work with 
Matrix.  You should list "The R Core Team" as a copyright holder on that 
file if you do this so you're not violating the R license.

Duncan Murdoch
On 2024-12-22 4:26 p.m., Mark Donoghoe wrote: