Skip to content

Instantly share code, notes, and snippets.

@webbedfeet
Created March 3, 2017 22:35
Show Gist options
  • Select an option

  • Save webbedfeet/67f4fc074104d36a64176e4b5e10afe2 to your computer and use it in GitHub Desktop.

Select an option

Save webbedfeet/67f4fc074104d36a64176e4b5e10afe2 to your computer and use it in GitHub Desktop.
Identifying which package the currently accessible function is from
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