Learn R Programming

DescTools (version 0.99.57)

GetCalls: Return All Used Functions Within a Function

Description

For screening purposes it can be useful to get a list of all function calls our function may depend on. GetCall() parses the function source and return all found function calls grouped by their package.

Usage

GetCalls(fun, alphabetic = TRUE, package = NULL)

Value

a list of vectors structered by package

Arguments

fun

the name of the function to be parsed

alphabetic

logic, determining the order of the result

package

name of the package, if only functions of this specific package should be returned.

Author

Nicholas Cooper <njcooper at gmx.co.uk> (in package NCmisc) with some tweaking by Andri Signorell <andri@signorell.net>

See Also

LsFct()

Examples

Run this code
GetCalls("t.test.default")

sapply(c("Closest", "Format"), 
       function(x) paste(unname(unlist(GetCalls(x))), collapse=", "))

Run the code above in your browser using DataLab