Skip to content
Prev 343478 / 398525 Next

Issue with formula conversion

Good point!

Here is an example:

library(nlme)
fm <- lme(yield ~ nitro, data=Oats, random=list(Block=pdComSymm(~Variety-1)))

Now the problem I'm facing is that the following part

pdComSymm(~Variety-1)

is read in as a string of characters from an external source:

ranEff <- 'pdComSymm(~Variety-1)'

The following

(ranEff1 <- as.formula(ranEff))
~Variety - 1

is not what I want. Even though

fm <- lme(yield ~ nitro, data=Oats, random=list(Block=pdCompSymm(ranEff1)))

works, I don't know the 'pdCompSymm' part in advance and would like to
make the process automatic.
On Wed, Aug 27, 2014 at 3:49 PM, David Winsemius <dwinsemius at comcast.net> wrote: