Skip to content

Instantly share code, notes, and snippets.

@hoxo-m
Created July 13, 2015 14:30
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 hoxo-m/0001a3e0732413086c7e to your computer and use it in GitHub Desktop.
Save hoxo-m/0001a3e0732413086c7e to your computer and use it in GitHub Desktop.
R のソースから関数を抽出
list_funcs <- function(file) {
Filter(function(expr) {
expr <- as.character(expr)
length(expr) == 3 && substring(expr[3], 1, 9) == "function("
}, as.list(parse(file)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment