Re: [Rd] Questions about calls and formulas

2005-08-22 Thread Duncan Murdoch
Erich Neuwirth wrote: >>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"

Re: [Rd] Questions about calls and formulas

2005-08-22 Thread Erich Neuwirth
> 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,

Re: [Rd] Questions about calls and formulas

2005-08-22 Thread Gabor Grothendieck
On 8/22/05, Erich Neuwirth <[EMAIL PROTECTED]> wrote: > > > >>(foo <- eval(substitute(x ~ g * h, list(x = as.name("weights") > > > > weights ~ g * h > > > >>class(foo) > > > > [1] "formula" > > > > > > ff<-formula("x~g*h") > (foo<-eval(substitute(ff,list(x=as.name("weights") > > gives >

Re: [Rd] Questions about calls and formulas

2005-08-22 Thread Erich Neuwirth
> >>(foo <- eval(substitute(x ~ g * h, list(x = as.name("weights") > > weights ~ g * h > >>class(foo) > > [1] "formula" > > ff<-formula("x~g*h") (foo<-eval(substitute(ff,list(x=as.name("weights") gives x ~ g * h what needs to be done to ff for the substitution to work? I fo

Re: [Rd] Questions about calls and formulas

2005-08-22 Thread Douglas Bates
On 8/22/05, Erich Neuwirth <[EMAIL PROTECTED]> wrote: > I am trying to adapt boxplot.formula (in graphics) to accept an > additional parameter, weights. > I already managed to adapt boxplot.default to do this. > > boxplot.formula prepares the data for a call to boxplot.default and to > achieve tha

[Rd] Questions about calls and formulas

2005-08-22 Thread Erich Neuwirth
I am trying to adapt boxplot.formula (in graphics) to accept an additional parameter, weights. I already managed to adapt boxplot.default to do this. boxplot.formula prepares the data for a call to boxplot.default and to achieve that does the following: It takes a formula like x~g*h as the f