I'm having trouble understanding how functions in the subset argument for lmList search for the objects they need. This trivial example produces "Error in rownames(fakedf) : Object "fakedf" not found":
library(nlme) fitbyID <- function() { fakedf <- data.frame(ID = gl(5, 10, 50), A = sample(1:100, 50), B = rnorm(50)) mycoefs <- lmList(B ~ A | ID, data = fakedf, subset = !is.element(rownames(fakedf), c("3", "10"))) coef(mycoefs) } fitbyID() If fakedf is already in the workspace, then the function runs fine, so rownames seems to be looking for it in the global environment, although I'd expect it to search locally first. I suspect this shows some gaps in my understanding of environments and related concepts. I'd be grateful for some advice on this. Best wishes, -- Sebastian P. Luque ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html