[Rd] Feature request: better warning message from or documentation of terms.formula when LHS variables are after . - on RHS

Benjamin Christoffersen boennecd @end|ng |rom gm@||@com
Mon Dec 14 16:53:38 CET 2020

Dear Sirs,

Running the following code with R devel (2020-11-30 r79529):

terms.formula(Surv(time, status) ~ . - time - status, data = lung[,
c("time", "status", "ph.ecog")])


  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

but it does not have an error.

Sincerely Yours,

More information about the R-devel mailing list