Re: [Rd] Creating S3 methods for S4 classes (coming from r-package-devel)

2018-05-24 Thread Michael Lawrence
On Thu, May 24, 2018 at 10:47 AM, Joris Meys wrote: > > > On Thu, May 24, 2018 at 6:20 PM, Michael Lawrence > wrote: >> >> You only have to make an S4 method if there is already an S4 generic. >> If there is just an S3 generic, then just define S3 methods on it. > > > I was refering to the recomm

Re: [Rd] Creating S3 methods for S4 classes (coming from r-package-devel)

2018-05-24 Thread Joris Meys
On Thu, May 24, 2018 at 6:20 PM, Michael Lawrence wrote: > You only have to make an S4 method if there is already an S4 generic. > If there is just an S3 generic, then just define S3 methods on it. I was refering to the recommendations in ?Methods_for_S3 ( https://stat.ethz.ch/R-manual/R-devel/

Re: [Rd] Creating S3 methods for S4 classes (coming from r-package-devel)

2018-05-24 Thread Michael Lawrence
You only have to make an S4 method if there is already an S4 generic. If there is just an S3 generic, then just define S3 methods on it. I think we should stay away from defining S4 generics when there is no good reason for them. Good reasons include multiple dispatch, or a non-default signature. N

Re: [Rd] Bug on qr.coef when qr is created by a zero matrix with colnames and all y equals zero

2018-05-24 Thread Martin Maechler
> Kun Ren > on Sat, 19 May 2018 08:17:37 + writes: > Dear maintainers, > I'm reporting a bug in qr.coef that mishandles the colnames of matrix. A minimal reproducible example is as follows: > x <- cbind(rep(0, 10), rep(0, 10)) > y <- rep(0, 10) > q <- qr.defa

[Rd] Creating S3 methods for S4 classes (coming from r-package-devel)

2018-05-24 Thread Joris Meys
Dear all, I asked this question on r-package-devel but Martin Maechler pointed out this was more suited on R-devel. So here it goes: per the manual, one should create and register both the S3 and a S4 method if one needs a method for an S4 class for a function using S3 dispatching. This is cumbe