getfunmap | R Documentation |
getfunmap takes in a directory of R files,and optionally a vector of filenames within which to search for functions and any calling relationships between them. It generates a 2-column matrix of edges between nodes ready for use by the graph_from_edgelist function from igraph. It identifies those functions that call other functions within the same R package, and maps only those. It also identifies those functions that are isolated and are only called from outside the package. Mapping all functions inside a larger package can lead to a complex visual mess of a map, hence the option of examining the relationships between a smaller given set of functions is provided with the checkfun argument. This is designed so that people may illustrate the design of their own R packages but can be used with any collection of R functions.
getfunmap(indir, checkfun = "", sortby = "function", files = "", outfile = "")
indir |
the directory containing R files for analysis |
checkfun |
a vector of functions whose relationships are to be mapped. If left as the default = ”, then all functions are mapped. |
sortby |
How should the functions object produced by describefunctions be sorted? Options are 'Rfile', function', 'calls', 'called-by', and even 'syntax' though that would be messy. |
files |
default = ”, but could be a list of R files to be found in indir that should be analysed, if left at default all R files will be used |
outfile |
the names of a txtfile (.csv spearated) to store the output from describefunctions, again default = ”, no file saved. |
a list of alledges, function matrix, the checkfun used, all edges, and a vector of the names of any isolated functions
describefunctions
print("wait on suitable example data")
# indir=rundir; checkfun=checkvar;sortby="function";files="";outfile=""
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.