Ah ok, I get the problem now.
I think you just need to modify model.matrix.formula as follows
model.matrix.formula <- function (frml, data = sys.frame(sys.parent()),
...)
{
if (!missing(data)) {
if (!inherits(data, "data.frame"))
stop("data must be a data.frame")
Hi Heather,
thanks, I would be able to add the variable y <- 1:nrow(aus), I would even
be able to omit these.
What concerns me is the fact that the presence of function
model.matrix.formula in package AlgDesign will stop model.matrix from
working as expected in further situations that I have no
Hi Ulrike,
It looks like 'aus' is created by fac.design(); is there any reason why
you can't add the variable
y <- 1:nrow(aus)
to this data frame and use y as the response in your formula?
Otherwise I think aus needs to be in the environment of frml (or frml
needs to be given the environment of a
Dear DevelopeRs,
in continuing with my suite of packages on experimental design, I am stuck
with an issue that appears to be related to package AlgDesign - I have tried
to get it solved by Bob Wheeler, but he seems to be stuck as well.
Whenever AlgDesign is loaded, some of my code does not work