I just discovered that when the VGAM package (not on CRAN) is loaded, glm() doesn't work. This is because VGAM defines a family function() which gets found by glm() in place of the family function from stats. Then VGAM:::family returns an object which doesn't have a $family component, (it has a component $vfamily). I thought namespaces should protect us from this happening? Kjetil -- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra -- No virus found in this outgoing message. Checked by AVG Anti-Virus.
Kjetil Brinchmann Halvorsen wrote:> I just discovered that when the VGAM package (not on CRAN) is loaded, > glm() doesn't work. This is because VGAM defines a family function() > which gets found > by glm() in place of the family function from stats. > Then VGAM:::family returns an object which doesn't have a $family > component, (it has a component > $vfamily). > > I thought namespaces should protect us from this happening?Yes and no: Yes: The namespace would protect you if glm would call internally the family function such as poisson(). No: Probably you have asked something like glm(....., family=poisson()). Now the first instance of poisson() in the search path is used. You are passing a call to poisson(), and this is not bound to any namespace. Of course you can specify tha namespace such as glm(....., family=stats::poisson()). Uwe Ligges> Kjetil >
As a workaround you could try detaching and re-attaching vgam before and after running glm. detach("package:vgam") glm(...whatever...) library(vgam) On 5/28/05, Kjetil Brinchmann Halvorsen <kjetil at acelerate.com> wrote:> I just discovered that when the VGAM package (not on CRAN) is loaded, > glm() doesn't work. This is because VGAM defines a family function() > which gets found > by glm() in place of the family function from stats. > Then VGAM:::family returns an object which doesn't have a $family > component, (it has a component > $vfamily). > > I thought namespaces should protect us from this happening? > > Kjetil > > -- > > Kjetil Halvorsen. > > Peace is the most effective weapon of mass construction. > -- Mahdi Elmandjra > > > > > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
Hello, It seems that if glm used a namespace then the conflict would be avoided? FYI, I released VGAM 0.6-3 last Friday which has binomial(), poisson() etc. removed so that it should no longer conflict with glm(). The families that work under VGAM are called binomialff(), poissonff() etc. Also, the Windows zip file for VGAM 0.6-3 was built under R 2.1.0. cheers Thomas