Skip to content
Prev 63407 / 63421 Next

In glm explicitly search stats for family functions

On 2026-03-09 7:53 a.m., Tim Taylor wrote:
There are several other cases in stats where functions assume that a 
function name passed as a string can be found on the search list.  They 
aren't always consistent about the search order:

C() searches for contr in the stats namespace first, as does 
make.tables.aovproj().

contrasts() does like glm() for family, it looks in the parent frame.
ks.test.default() likewise.

make.tables.aovprojlist() looks locally first, but doesn't restrict the 
search to functions.

I'm not sure I spotted all cases of this, and I didn't look in any other 
base packages besides stats.

So I think a patch to fix this should determine a consistent approach, 
and apply it everywhere.  Maybe too big a can of worms?

Duncan Murdoch