pkgnet icon indicating copy to clipboard operation
pkgnet copied to clipboard

Function Network Plots Not 100% Repeatable

Open bburns632 opened this issue 6 years ago • 1 comments

If you render the visualization for the function network multiple times in a row, you will see a few different versions.

To observe this, run:

library(pkgnet)
t <- CreatePackageReport("lubridate")
t[["PackageFunctionReporter"]]$plot_network()

... and repeat...

bburns632 avatar Mar 22 '18 14:03 bburns632

This happens because there's some amount of randomness to the graph layout functions. I think we should be able to solve this by doing set.seed.

Compare repeated runs of

library(pkgnet)
foo <- FunctionReporter$new()
foo$set_package('baseballstats')
foo$graph_viz

vs.

library(pkgnet)
foo <- FunctionReporter$new()
foo$set_package('baseballstats')
set.seed(42)
foo$graph_viz

jayqi avatar Dec 19 '18 04:12 jayqi