Closed davidaarmstrong closed 4 years ago
Thanks for this! I think it's preferable to use inherits(obj, "classname")
(or is.data.frame(obj)
for data.frames) instead of "classname" %in% class(obj)
, so I've checked in a new commit that fixes these issues that way. Will push to CRAN shortly.
The pscl package was failing R CMD check on R-devel (particularly on linux systems) because of a new policy for classes and as such is about to be archived. Apparently, R will now assign some built-in classes to objects independent of those assigned by the function/user. As such, class(x) generally returns a vector of at least length 2, so any (in)equality, like
class(x) == "x"
triggers an error. I changed allif(class(x)=="x")
statements toif("x %in% class(x))
and allif(class(x)!="x")
toif(!("x" %in% class(x)))
. After doing so, the package checked clean on R-devel (Debian 9.5).