Created
October 13, 2014 02:14
-
-
Save robertzk/fb094265fc3336a45ff4 to your computer and use it in GitHub Desktop.
Incredibly useful R trick!
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
```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