NCmisc (version 1.1.6)

list.functions.in.file: 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)

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.

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.

Author

Nicholas Cooper njcooper@gmx.co.uk

See Also

Rfile.index

Examples

Run this code
# not run:  rfile <- file.choose() # choose an R script file with functions
# not run:  list.functions.in.file(rfile)

Run the code above in your browser using DataLab