Re: [Rd] model.frame and parent environment

2014-06-17 Thread Therneau, Terry M., Ph.D.
Duncan, You missed the point. (I sometimes write too tersely, so I take the blame.) Users are writing their own "myfun". I want model.frame to work for them, without forcing the user to learn environment trickery. The actual question from the user was a call to fit <- coxph(formul

Re: [Rd] model.frame and parent environment

2014-06-16 Thread Therneau, Terry M., Ph.D.
I had a typo in the prior example when transcribing from R to the message, now corrected below. (The call to myfun). My apologies for that. Corrected message below. Someone has reported a problem with predict.coxph that I can't seem to solve. The underlying issue is with model.frame.coxph;

Re: [Rd] model.frame and parent environment

2014-06-16 Thread Prof Brian Ripley
On 16/06/2014 19:35, Therneau, Terry M., Ph.D. wrote: Someone has reported a problem with predict.coxph that I can't seem to solve. The underlying issue is with model.frame.coxph; the same issue is also found in lm so I'll use that for the example. -- > test <- data.fr

[Rd] model.frame and parent environment

2014-06-16 Thread Therneau, Terry M., Ph.D.
Someone has reported a problem with predict.coxph that I can't seem to solve. The underlying issue is with model.frame.coxph; the same issue is also found in lm so I'll use that for the example. -- > test <- data.frame(y = 1:10 + runif(10), x=1:10) > myfun <- function