Helper functions to create and filter igraph objects
manage_igraph_object.Rmdcodexplor offering functions to manage
igraph object : turn an edgelist into an igraph object,
filter some nodes accordingly to their indegrees or outdegrees, etc.
Once you have a network such as the network of internal dependancies
within a project computed by codexplor::construct_corpus
(see the vignette
of construct_corpus()).
net <- construct_corpus(repos = "clement-lvd/codexplor")
# by default, codexplor deal with R project
-
Turn your Citations Network into a directed
igraphnetwork withnetig <- codexplor::get_igraph_from_df(net$functions.network) -
Once you have an igraph object, extract the egonetwork of a precise function with
filter_net <- filter_igraph_egonetwork(netig, "an_interesting_function") -
Turn it into an interactive
networkD3dataviz withdataviz_filtered <- get_networkd3_from_igraph(filter_net) or pass a citations.network data.frame dataviz <- get_networkd3_from_igraph(net$functions.network) -
And tweak the legend of the interactive
networkD3dataviz withmove_networkd3_legend(dataviz, x_pos = 0.4, y_pos = 1, orientation = "horizontal") …