-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to generate call graph on a function and not a package #46
Comments
I was also wondering if this is possible. From the documentation at |
Hi, so sorry this apparently slipped by my radar for a full year (mea culpa). The issue here is that you can't build a callGraph for a specific invocation, only for functions or packages as a whole.
does work for me, though from what I'm seeing its not properly (fully) recursive, as |
The CodeAnalysis package is probably a better place to get this functionality. |
@duncantl does the functionality in https://github.com/duncantl/CodeAnalysis fully subsume A very brief glance at callGraph.R didn't show me the option for being recursive, but then, the recursive argument here isn't connected to anything, so I guess that's a wash? |
FYI, I added this top-level functionality in CodeAnalysis, i.e., g = callGraph(quote ( lm ( mpg ~ wt + cyl, mtcars) ) ), recursive = 2)
plot(g) gives the call information and draws the graph. One can use recursive = TRUE or recursive = positive.integer to get the entire call graph (typically way to big and takes a while) or the first "positive.integer" descendants/layers from the current call. One can use callGraph( "lm ( mpg ~ wt + cyl, mtcars) ", recursive = 3) but working directly with the language objects is better, e.g., quote above or callGraph(parse(text = codeString) , recursive = 2) |
How is one supposed to create a call-graph using
makeCallGraph
on a function call?For example, if I wanted to know all the functions that get called by doing:
I would have thought I would do something like:
But I get the error:
The text was updated successfully, but these errors were encountered: