list.functions.in.file {NCmisc} | R Documentation |
Show all functions used in an R script file, by package
Description
Parses all functions called by an R script and then lists them by package. Wrapper for 'getParseData'. Inspired by 'hrbrmstr', on StackExchange 3/1/2015. May be of great use for those developing a package to help see what namespace 'importsFrom' calls will be required.
Usage
list.functions.in.file(filename, alphabetic = TRUE)
Arguments
filename |
path to an R file containing R code. |
alphabetic |
logical, whether to list functions alphabetically. If FALSE, will list in order of appearance. |
Value
Returns a list. Parses all functions called by an R script and then lists them by package. Those from the script itself are listed under '.GlobalEnv' and any functions that may originate from multiple packages have all possibilities listed. Those listed under 'character(0)' are those for which a package could not be found- may be functions within functions, or from packages that aren't loaded.
Author(s)
Nicholas Cooper njcooper@gmx.co.uk
See Also
Examples
# not run: rfile <- file.choose() # choose an R script file with functions
# not run: list.functions.in.file(rfile)