r-hyperspec / hyperSpec

hyperSpec: Tools for Spectroscopy (R package)
https://r-hyperspec.github.io/hyperSpec/
GNU General Public License v3.0
12 stars 3 forks source link

Use `inherits()` instead of `is()` in `chk.hy()` #32

Closed GegznaV closed 3 years ago

GegznaV commented 3 years ago

I'm planning to update chk.hy() and related functions. This would be one of the steps.


The documentation of methods::is() says:

Although inherits is defined for S3 classes, it has been modified so that the result returned is nearly always equivalent to is, both for S4 and non-S4 objects. Since it is implemented in C, it is somewhat faster. The only non-equivalences arise from use of setIs, which should rarely be encountered.

Is it OK for you @cbeleites, @bryanhanson to use inherits() instead of is() in chk.hy()?

bryanhanson commented 3 years ago

I think I follow the reasoning in these related issues, they sound fine to me but CB should have the final say.