Charis Tzagarakis
2002-May-10 00:49 UTC
[R] Conflict between 'nlme' and 'methods' on R-1.5.0 ?
Hi there! I use R with the packages 'nlme' and 'methods'.Upon upgrading to R1.5.0, I got the following message when loading nlme (after having loaded 'methods'): The following object(s) are masked from package:methods : initialize After that, when I use my class definitions and scripts(which worked fine in 1.4.1) I get the following error message when a new("class") expression is used: Error in initialize(value, ...) : no applicable method for "initialize" Clearly the problem arises because 'nlme' contains an 'initialize' function, as does the new 'methods' package.Is there any workaround? Thanks! Charis Tzagarakis Charidimos Tzagarakis MD Brain Sciences Center and University of Minnesota. Address: Brain Sciences Center (11B) Minneapolis VA Medical Center One Veterans Drive 55417 Minneapolis MN USA Tel:612-725-2000 ext 1756 email: htzag at umn.edu -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Douglas Bates
2002-May-10 18:26 UTC
[R] Conflict between 'nlme' and 'methods' on R-1.5.0 ?
"Charis Tzagarakis" <htzag at umn.edu> writes:> I use R with the packages 'nlme' and 'methods'.Upon upgrading to R1.5.0, I got the following > message when loading nlme (after having loaded 'methods'): > The following object(s) are masked from package:methods : > > initialize > After that, when I use my class definitions and scripts(which worked fine in 1.4.1) I get the > following error message when a new("class") expression is used: > Error in initialize(value, ...) : no applicable method for "initialize"> Clearly the problem arises because 'nlme' contains an 'initialize' > function, as does the new 'methods' package.Exactly.> Is there any workaround?Well loading the packages in the other order avoids the warning but then lme and related model-fitting functions don't work. :-) In the long term this problem will be solved by namespaces (anticipated by R-1.6.0) and by rewriting the nlme package to use S4-style classes and methods. In the short term we could rename initialize as Initialize in the nlme package but I don't want to do that because the initialize function is explicitly mentioned in Pinheiro and Bates (Springer, 2000). Also this runs the risk of breaking other code that depends on the nlme package. You could do that as a "quick and dirty" workaround. Download the sources for the nlme package, rename it, substitute "Initialize" for "initialize" in all the .R files in the R directory, and install the package. I will check with other members of R-core to see if anyone can come up with a more elegant fix. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._