Description CI bootstrap network inference Network visualization Utils functions
The foodingraph package provide two categories of functions :
confidence-interval (CI) bootstrap inference of mutual information (MI) or maximal information coefficient (MIC) adjacency matrices.
network visualization in a graph using igraph
and
ggraph
The two functions are
boot_cat_bin
: a function to perform the CI bootstrap
inference for pairwise associations between ordinal and binary variables.
It uses thresholds defined by simulation of independent associations using
boot_simulated_cat_bin
, such that it simulates independent
associations between ordinal-ordinal, binary-binary and ordinal-binary pairs
of variables.
It calculates the CI bootstraps for each pairwise association of the variables'
dataset, then compares the 1st percentile of these CI to the corresponding
thresholds of independent data.
boot_simulated_cat_bin
: a function to determine the threshold
values of MI or MIC of independent pairs
of variables (ordinal vs. ordinal, and binary vs binary and ordinal vs. binary).
It calculates the CI bootstraps of MI or MIC for these pairs of variables,
and return a defined percentile of these CI (e.g. 99th percentile).
The three main functions are
graph_from_matrix
: create a graph from an adjacency matrix.
This function need at least two arguments : 1. the adjacency matrix, in
which the column names and row names are the node names. 2. the legend,
which is a data frame of at least two columns : name
(the name of the nodes
in the adjacency matrix, e.g. CRUDSAL_cat) and title
(the titles for each
name, e.g. raw vegetables)
Optionally, you can add a column family
to specify the nodes' families.
graph_from_links_nodes
: create a graph from a list of nodes
and links. This function needs two arguments : 1. the list of nodes
and links, which should be the result from links_nodes_from_mat
(if not, make sure the structure corresponds). 2. the legend
(described above).
compare_graphs
: a function to compare two graphs.
It unifies the legends and attributes, so the graphs can be visually
comparable.
save_graph
: a function to save the graph in a file at high
resolution.
Other functions include
family_palette
: to create a color palette to be used in the
graph. It is usually done automatically, but can prove useful if comparing multiple
graphs, to ensure the family colors remain the same throughout the graphs.
links_nodes_from_mat
: to extract the links and nodes from an
adjacency matrix
mic_adj_matrix
: using the cstats
function from
the minerva package, calculate the adjacency MIC matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.