Skip to contents

This vignette give a basic understanding of the files.network data.frame, one of the df returned within a list by codexplor::construct_corpus (see vignette of construct_corpus).

Overview

The corpus.list computed by codexplor::construct_corpus have some data.frame with additional classes citations.network and internal.dependencies (see the vignette of the citations.network data.frame). These are the edgelists of networks of internal dependencies, such as :

  • a network of the functions defined within the files of the corpus,
  • or a network of files.

In the files.network (one of the citations.network of internal.dependencies from the corpus.list), links start from the programming file that calls a function and point to the programming file where the function is defined.

Example

Given folders path(s) and/or github repo(s), codexplor::construct_corpus compute citations networks of the internal dependencies within programming project(s).

require(codexplor)

net <- construct_corpus(
  repos =  "tidyverse/stringr")
# by default, codexplor deal with R project

get_networkd3_from_igraph(net$files.network
  , title_h1 = "stringr"
  , subtitle_h2 = "files.network")
# Return an interactive dataviz' from networkD3

By default, get_networkd3_from_igraph will colorize the nodes accordingly to their indegrees. This reveal the local dependencies of the programming project, here the files with exposed functions that are used by others files of the project.

.
.

For example, the most-common local dependency inside the tidyverse/stringr repo is modifiers.R and compat-types-check.R. Next, there is other text-mining metrics that will give us insights about these files, e.g., one should verify that the local complexity of these files are reported as a ‘trivial’ level (see next section).

Playing with the parameters of get_networkd3_from_igraph will reveal others insights, e.g., you should try to color nodes accordingly to their outdegrees, in order to reveal the files that contain high-level functions of the project.

  get_networkd3_from_igraph(net$files.network,  color_outdeg_instead_of_indeg = T)
  

Mix Network Analysis and Document-level Metrics

[WIP]