[Rd] specials and ::

Chris Black chr|@ @end|ng |rom ckb|@ck@org
Mon Aug 26 18:26:46 CEST 2024


It’s completely reasonable to decline to do extra work to support it, but at the same time: Qualified calls are widely used and recommended, and users are also being completely reasonable when they try to use them (probably without checking the manual!) and expect them to work.

Would there be a tolerably easy way to make the fit fail loudly on `survival::strata(…)` rather than return the wrong result?



> On Aug 26, 2024, at 7:42 AM, Therneau, Terry M., Ph.D. via R-devel <r-devel using r-project.org> wrote:
> 
> The survival package makes significant use of the "specials" argument of terms(), before 
> calling model.frame; it is part of nearly every modeling function. The reason is that 
> strata argments simply have to be handled differently than other things on the right hand 
> side. Likewise for tt() and cluster(), though those are much less frequent.
> 
> I now get "bug reports" from the growing segment that believes one should put 
> packagename:: in front of every single instance.   For instance
>       fit <- survival::survdiff( survival::Surv(time, status) ~ ph.karno + 
> survival::strata(inst),  data= survival::lung)
> 
> This fails to give the correct answer because it fools terms(formula, specials= 
> "strata").    I've stood firm in my response of "that's your bug, not mine", but I begin 
> to believe I am swimming uphill.   One person responded that it was company policy to 
> qualify everything.
> 
> I don't see an easy way to fix survival, and even if I did it would be a tremendous amout 
> of work.   What are other's thoughts?
> 
> Terry
> 
> 
> 
> -- 
> 
> Terry M Therneau, PhD
> Department of Quantitative Health Sciences
> Mayo Clinic
> therneau using mayo.edu
> 
> "TERR-ree THUR-noh"
> 
> [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list