Created
March 22, 2014 19:13
-
-
Save stevenpollack/9712662 to your computer and use it in GitHub Desktop.
check whether a function is an S3 Generic in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isFuncS3Generic <- function(func) { | |
funcBody <- body(func) | |
sum(grepl(pattern="UseMethod", x=funcBody)) != 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment