finding functions relying on another function

Hey all

I am developing a package containing a number of functions. Some of my function uses some helper functions to e.g. create a dialog for selecting folders or sorting tables.

Now my question is:
lets say I am working on the function: "outdirselect" and I want to know which other functions might be effected by the change.

How do I easily find functions that depend on this function??

I could go through all of my R files an search for the name but I was wondering if there might be a better (more easy) way to do this??

Kind regards

Yes, RStudio (and other IDEs as well, or even command line tools) can search multiple files, so that is one solution.

There are more formal tools, like GitHub - r-lib/pkgapi: Create a map of functions for an R package - WORK IN PROGRESS! can return a data frame of function calls, with function locations. This might be overkill if your package is on the smaller side, and YMMV in general.

1 Like

Hey Gabor, thanks for the answer sounds promissing this pkgapi. I found the "find in files" and it worked ok but since the name of the function sometimes turnes up several places it did not really give me the result I was hoping for. Anyway, it works much better then manually going through.

btw the solution, though not ideal, was simplly to go to edit -> find in files.
Make sure to select correct folder and select R scrpts (my selection) since otherwise the results were to overwhelming.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.