[R] building lme call via call()

Vito Muggeo (UniPa) vito.muggeo at unipa.it
Mon Oct 25 18:16:21 CEST 2010


dear all,
I would like to get the lme call without fitting the relevant model.

library(nlme)
data(Orthodont)
fm1 <- lme(distance ~ age, random=list(Subject=~age),data = Orthodont)

To get fm1$call without fitting the model I use call():

my.cc<-call("lme.formula", fixed= distance ~ age, random = list(Subject 
= ~age))

However the two calls are not the same (apart from the data argument I 
am not interested in), as call() *does* evaluate the arguments:

 > my.cc$random
$Subject
~age

 > fm1$call$random
list(Subject = ~age)

How is it possible to get the right call (similar to the one from 
fm1$call) by means of call()?

thanks,
vito



-- 
====================================
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 23895240
fax: 091 485726/485612
http://dssm.unipa.it/vmuggeo



More information about the R-help mailing list