[R-pkg-devel] Guidelines for S3 regression models

Stephen Milborrow milbo at sonic.net
Fri Jun 26 13:29:40 CEST 2015

Once we have built a regression model, we typically want to use the model
for further processing, such as making predictions from the model or
plotting the residuals.  Unfortunately, for many packages on CRAN this can
be difficult.

For example, some models don't have a residuals method and don't save the
call or data --- so you can't tell how to generate the residuals from the
model object itself.

A common snag is that for some models the new data for predict() has to be a
matrix; for others it has to be a data.frame.  This places an unnecessary
burden on the user when both data.frames and matrices can easily be
supported by predict.

To mitigate such issues, I'm going out on a limb and presenting some
guidelines for writers of S3 regression model functions (this document is
currently part of the plotmo package):


Your comments would be appreciated.

Stephen Milborrow

More information about the R-package-devel mailing list