Hi,
I am now trying to use update.formula from within a function but I am
not able to get the result I want. Here is an example
f <- function(fm, n) {
update(fm, n*. ~ .);
}
If I run
> fm <- formula( y ~ a + b )
> f(fm,3)
n * y ~ a + b
Now when I try to use the formula, n does not exis
Its ok.
I've just read about update.formula in another message.
Paul
Paul Emberson wrote:
Hi,
I am trying to write a function which takes a formula as input and
outputs a new formula with a different response while keeping the rest
of the formula the same.
I.e.
respapply : ( y ~ a+b ) ->
Hi,
I am trying to write a function which takes a formula as input and
outputs a new formula with a different response while keeping the rest
of the formula the same.
I.e.
respapply : ( y ~ a+b ) -> ( f(y) ~ a + b )
I have tried the following but it doesn't work. The terms become
invalid
3 matches
Mail list logo