Re: [R-pkg-devel] testing coercion

2018-12-06 Thread Kevin Coombes
Thanks for the suggestion. But it may not be quite expressive enough; I think I will instead use > ifelse(getRversion() < "3.6.0", > ! canCoerce(wv, "double"), # fails in older versions > canCoerce(wv, "double")) # works in newer versions That way, when I update the p

Re: [R-pkg-devel] testing coercion

2018-12-06 Thread Sebastian Meyer
Hi Kevin, I think using > canCoerce(wv, "double") || getRversion() < "3.6.0" could solve the issue of an inconsistent test result and is descriptive. Best regards, Sebastian Am 06.12.18 um 16:59 schrieb Kevin Coombes: > Hi, > > A package I recently submitted to CRAN includes an S4

[R-pkg-devel] testing coercion

2018-12-06 Thread Kevin Coombes
Hi, A package I recently submitted to CRAN includes an S4 class that defines a method to coerce from that class to a numeric vector, basically through > setAs("myClass", "numeric", function(from) from@psi) Being perhaps overly compulsive about trying to test everything while documenting behavi