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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Benjamin Christoffersen
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel