|Summary:||isS3method incorrectly returns FALSE for is.na.data.frame|
|Product:||R||Reporter:||Richard Cotton <richierocks>|
|Attachments:||suggested fix for isS3method|
Description Richard Cotton 2016-10-26 06:19:09 UTC
To reproduce: isS3method("is.na.data.frame") ##  FALSE This should return TRUE, since is.na.data.frame is the S3 method of is.na for data.frame objects, as seen by methods(is.na) ##  is.na.POSIXlt is.na.data.frame is.na.numeric_version is.na.raster* ## see '?methods' for accessing help and source code and documented on the ?is.na help page.
Comment 1 Richard Cotton 2016-10-27 08:55:40 UTC
Created attachment 2174 [details] suggested fix for isS3method I've attached a possible fix for isS3method that loops over all choices of generic/class combinations. For example, with "is.na.data.frame" as the input, it would check fn = "is" and class = "na.data.frame" fn = "is.na" and class = "data.frame" fn = "is.na.data" and class = "frame"
Comment 2 Martin Maechler 2016-11-01 17:53:34 UTC
Thank you, Richie. Your suggestion is good "in spirit" but has too many changes compared to the source. My fix uses the (same ?) approach : look at all possible cases and return (TRUE) immediately if one case "works". I may not get to commit my fix by tomorrow, but there's no need for more proposals.
Comment 3 Martin Maechler 2016-11-12 18:47:52 UTC
Committed the fix r71618 | maechler | 2016-11-03 12:48:47 +0100 (to R-devel) and ported to 'R 3.3.2 patched'.