Skip to content

Instantly share code, notes, and snippets.

@datalove
Last active January 31, 2017 18:18
Show Gist options
  • Save datalove/88f5a24758b2d8356e32 to your computer and use it in GitHub Desktop.
Save datalove/88f5a24758b2d8356e32 to your computer and use it in GitHub Desktop.
How to take an R function that isn't generic, make it generic and add method for your class without breaking the standard functionality
identical <- function(x) UseMethod("identical")
identical.my_class <- function(x) do_something(x)
identical.default <- base::identical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment