Re: [Rd] model.matrix troubles with AlgDesign

2009-09-29 Thread Heather Turner
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")

Re: [Rd] model.matrix troubles with AlgDesign

2009-09-29 Thread Ulrike Groemping
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

Re: [Rd] model.matrix troubles with AlgDesign

2009-09-29 Thread Heather Turner
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