[R-pkg-devel] Recommendation on qr method export

Charles Determan cdetermanjr at gmail.com
Tue Aug 2 21:17:39 CEST 2016


Hello,

I am currently working on an implementation of QR decomposition (leveraging
a C++ library via Rcpp).  Naturally I would like to have the R syntax as
similar as possible to base R 'qr' function.  Given the class structure of
my package my instinct was to export an S4/S3 method.

However, the QR decomposition doesn't store the final QR matrix in the same
format as base R via LINPACK, nor does it return 'qraux', 'rank' or 'pivot'
objects but instead a 'betas' object.  The final 'R' and 'Q' matrices are
in fact identical to those ultimately returned by qr.R or qr.Q.

So my question is, given these differences, should I just create a
different function name or would creating a qr.myclass dispatch be
acceptable (whether S3 or S4)?  I would prefer the latter as I would like
the classes to potentially take advantage of previously written code using
'qr'.

Thanks,
Charles

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list