Re: [Rd] issue with [[<-Call

2008-12-26 Thread Prof Brian Ripley
On Fri, 26 Dec 2008, Therneau, Terry M., Ph.D. wrote: Brian, Thanks for the comments. -- I agree that the vector form is more compact. I was using a loop because I found it to be even more transparent to the class. For a one time task such as this efficiency is not an issue. -- I'll make use

Re: [Rd] issue with [[<-Call

2008-12-26 Thread Therneau, Terry M., Ph.D.
Brian, Thanks for the comments. -- I agree that the vector form is more compact. I was using a loop because I found it to be even more transparent to the class. For a one time task such as this efficiency is not an issue. -- I'll make use of eval.parent(). I hadn't yet stumbled on that -- T

Re: [Rd] issue with [[<-Call

2008-12-26 Thread Prof Brian Ripley
The issue is that you are using [["weights"]] to add an element. It works for existing eleents as well as for [<- and $<-. However, I would have done this without a loop nm <- c("data", "weights", "subset", "na.action") extras <- nm %in% names(Call) temp[ nm[extras] ] <

Re: [Rd] issue with [[<-Call

2008-12-25 Thread Charles C. Berry
On Thu, 25 Dec 2008, Terry Therneau wrote: The following code works in Splus but not in R coxph <- function(formula, data, weights, subset, na.action, init, control, method= c("efron", "breslow", "exact"), singular.ok =TRUE, robust=FALSE, model=FALSE, x=FALSE, y=TRUE, .

[Rd] issue with [[<-Call

2008-12-25 Thread Terry Therneau
The following code works in Splus but not in R coxph <- function(formula, data, weights, subset, na.action, init, control, method= c("efron", "breslow", "exact"), singular.ok =TRUE, robust=FALSE, model=FALSE, x=FALSE, y=TRUE, ...) { method <- match.arg(method) Ca