I am using R to teach, and here are a couple of things that I thought would work didn't work. 1. I noticed the utility data(***,package=***) recently and like it very much, but unless I type in the whole word "package" I'll get an error in 1.4.0. For example, data(cats,package=MASS) works fine but data(cats,pac=MASS) doesn't. 2. drop1 doesn't seem to be as smart as before. In the sequence below, drop1 didn't produce what I expected it to produce. data(HairEyeColor); lab<-dimnames(HairEyeColor) HairEye<-cbind(expand.grid(Hair=lab$Hair,Eye=lab$Eye, Sex=lab$Sex),Fr=as.vector(HairEyeColor)) HairEye.fit<-glm(Fr~.^2,poisson,HairEye) drop1(HairEye.fit) The following sequence however works. HairEye.fit<-glm(Fr~(Hair+Eye+Sex)^2,poisson,HairEye) drop1(HairEye.fit) Chong Gu -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Chong Gu <chong at stat.purdue.edu> writes:> I am using R to teach, and here are a couple of things that I thought > would work didn't work. > > 1. I noticed the utility data(***,package=***) recently and like it > very much, but unless I type in the whole word "package" I'll get an > error in 1.4.0. For example, data(cats,package=MASS) works fine but > data(cats,pac=MASS) doesn't.This happens every time an argument follows a "..." argument. This is by design. The need for this is not too obvious in the case of data(), but consider c(x=4,r=7) with the "r" matching "recursive"...> > 2. drop1 doesn't seem to be as smart as before. In the sequence > below, drop1 didn't produce what I expected it to produce. > > data(HairEyeColor); lab<-dimnames(HairEyeColor) > HairEye<-cbind(expand.grid(Hair=lab$Hair,Eye=lab$Eye, > Sex=lab$Sex),Fr=as.vector(HairEyeColor)) > HairEye.fit<-glm(Fr~.^2,poisson,HairEye) > drop1(HairEye.fit)This does look wrong. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 8 Feb 2002, Chong Gu wrote:> > I am using R to teach, and here are a couple of things that I thought > would work didn't work. > > 1. I noticed the utility data(***,package=***) recently and like it > very much, but unless I type in the whole word "package" I'll get an > error in 1.4.0. For example, data(cats,package=MASS) works fine but > data(cats,pac=MASS) doesn't. > > 2. drop1 doesn't seem to be as smart as before. In the sequence > below, drop1 didn't produce what I expected it to produce. > > data(HairEyeColor); lab<-dimnames(HairEyeColor) > HairEye<-cbind(expand.grid(Hair=lab$Hair,Eye=lab$Eye, > Sex=lab$Sex),Fr=as.vector(HairEyeColor)) > HairEye.fit<-glm(Fr~.^2,poisson,HairEye) > drop1(HairEye.fit) > > The following sequence however works. > > HairEye.fit<-glm(Fr~(Hair+Eye+Sex)^2,poisson,HairEye) > drop1(HairEye.fit)It's not a change in drop1, though, where the basis of this (drop.scope) is unchanged since 1999. I suspect a side effect of changes in the formula/terms handling. Do you know when it did work? -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._