[Rd] .S4methods inconsistent behavior with methods, .S3methods

Richard Cotton richierocks at gmail.com
Thu Nov 3 09:07:26 CET 2016


If I call

.S4methods(sd)

I get the error

## Error in getGeneric(generic.function) :
##   argument 'f' must be a string, generic function, or primitive:
got an ordinary function

By contrast, methods and .S3methods just state that no methods are found.

methods(sd)
## no methods found
S3methods(sd)
## no methods found

It seems like the behavior of these functions ought to be consistent.

Maybe they should split the difference and say no methods are found,
but warn the the input is not generic?

-- 
Regards,
Richie

Learning R
4dpiecharts.com



More information about the R-devel mailing list