Benjamin Christoffersen
2020-Dec-14 15:53 UTC
[Rd] Feature request: better warning message from or documentation of terms.formula when LHS variables are after . - on RHS
Dear Sirs, Running the following code with R devel (2020-11-30 r79529): library(survival) terms.formula(Surv(time, status) ~ . - time - status, data = lung[, c("time", "status", "ph.ecog")]) gives: Warning message: In terms.formula(Surv(time, status) ~ . - time - status, data = lung[, : 'varlist' has changed (from nvar=2) to new 4 after EncodeVars() -- should no longer happen! It took me a while to figure out that the cause of the warning is that time and status appear on both the left hand side and on the right hand side of the formula after a period and a minus. While this is likely an error or redundant in almost all cases, it was unclear from the warning and the .Rd file. This is somewhat related to https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17895 but it does not have an error. Sincerely Yours, Benjamin