[Rd] documentation patch for as.formula → reformulate

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Sun Jan 9 22:39:43 CET 2022


   There was some discussion on twitter about the fact that the manual 
page for as.formula() doesn't mention reformulate(), and indeed the last 
example is

## Create a formula for a model with a large number of variables:
      xnam <- paste0("x", 1:25)
      (fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+"))))


which could arguably be better done as

   reformulate(xname, response = "y")

   I've attached a documentation patch that adds the alternative version 
and a \seealso{} link.

   Happy to submit to r-bugzilla if requested.

   cheers
    Ben Bolker

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: reformulate_patch.txt
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20220109/f3266495/attachment.txt>


More information about the R-devel mailing list