[R] Using nlme and coxme (both!): Looking for workaround

Dieter Menne dieter.menne at menne-biomed.de
Thu Mar 18 12:26:37 CET 2010


I am trying to use nlme and coxme in one Sweave document. I have read the
thread in r-devel on the subject, 

http://markmail.org/thread/snchg6ynofrzbf2v

and nlme::fixef works, but I did not understand what workaround to use when
I am calling a function in a package that I do not want to change.

Dieter



library(nlme)
library(coxme) # hides fixef, among others

deplynestedforeingpackagefunction = function(x){
  # I do not want to change this function in another package
  fixef(x)
}

fit <- coxme(Surv(time, status) ~ age + (1|ph.ecog), lung) 
fixef(fit)

fm1 <- lme(distance ~ age, data = Orthodont)
nlme::fixef(fm1) # can use nlme::
# 
deplynestedforeingpackagefunction(fm1) #error



R version 2.10.1 (2009-12-14) 
i386-pc-mingw32 

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] splines   stats     graphics  grDevices datasets  utils     methods
base     

other attached packages:
[1] coxme_2.0       bdsmatrix_1.0   survival_2.35-8 nlme_3.1-96    

loaded via a namespace (and not attached):
[1] grid_2.10.1    lattice_0.18-3 tools_2.10.1  
>



More information about the R-help mailing list