Learn R Programming

lares (version 4.8.4)

list_fun_file: List 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'. May be of great use for those developing a package to help see what namespace 'importsFrom' calls will be required.

Usage

list_fun_file(filename, alphabetic = TRUE)

Arguments

filename

Character. Path to an R file containing R code.

alphabetic

Boolean. 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.

Examples

Run this code
# NOT RUN {
# Choose an R script file with functions
rfile <- file.choose()
list_fun_file(rfile)
# }

Run the code above in your browser using DataLab