Helper functions to create and filter igraph objects
manage_igraph_object.Rmd
codexplor
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
igraph
network 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
networkD3
dataviz 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
networkD3
dataviz withmove_networkd3_legend(dataviz, x_pos = 0.4, y_pos = 1, orientation = "horizontal")
…