Are there any tools that can visualize R code?
I have some very complex R code split between several scripts that I need to understand. Part of the difficulty of this is that there are so many nested functions and variables that it's proving extremely slow going to go through it manually and figure out what connects to what.
I think my task might be easier if there were some way to generate a flow chart from R code, so that I can see it all at once. Of course, I can just draw out a map as I go through the code, but shouldn't it be programatically possible to do this? Are there any existing tools that can do it?
I have found a program called R AnalyticFlow, but it seems to MAKE scripts using a GUI, whereas I want something that can take code and make it into the type of thing that one would draw in AnalyticFlow.
You can visualize your functions in a easy way using the mvbills
package.
Install/import
install.packages("mvbutils", dependencies = TRUE)
library(mvbutils)
And use
foodweb(where = environment())
In my case, an example of output would be:
Or if it's a package (or you just want to try other option), you can use the DependenciesGraphs package.
Even though this question is already a bit old there is a nice R-package called flow
that might be very useful for the task:
https://moodymudskipper.github.io/flow/index.html
It graphically visualizes functions, if-then-else statements and more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With