Skip to content

Instantly share code, notes, and snippets.

@robertzk
Created October 13, 2014 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertzk/fb094265fc3336a45ff4 to your computer and use it in GitHub Desktop.
Save robertzk/fb094265fc3336a45ff4 to your computer and use it in GitHub Desktop.
Incredibly useful R trick!
```R
> getGroup("==", recursive = TRUE)
[[1]]
[1] "Compare"
[[2]]
[1] "Ops"
```
Allows determining group of an operator, useful when wanting to override arithmetic and others and not knowing where to look in the documentation.
We can then
```R
setMethod("Compare", signature = c("our", "classes"), def = ...)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment