> Try do.call like this: > > ff <- x ~ g*h > do.call("substitute", list(ff, list(x = as.name("weight")))) >
It is even more complicated. All I know is that ff is a formula with an expression on the left hand side. This expression needs to be replaced by "weights". According to the documentation, substitute only handles replacement of variables by something else, and that is not enough in my case. -- Erich Neuwirth, Didactic Center for Computer Science University of Vienna Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39902 Fax: +43-1-4277-9399 ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel