Created
March 3, 2017 22:35
-
-
Save webbedfeet/67f4fc074104d36a64176e4b5e10afe2 to your computer and use it in GitHub Desktop.
Identifying which package the currently accessible function is from
This file contains hidden or 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
| whichfn <- function(fun){ | |
| require(stringr) | |
| str_match(capture.output(environment(fun)),'namespace:(\\w+)')[,2] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment