Description Usage Arguments Value Examples
get_tripartite
builds a properly-structured tripartite graph
from a file or from a data.frame
containing raw data. This object can then
be used by the other functions of this package. The structure
of the input data and of the resulting structure is detailed below.
1 | get_tripartite(filename = NULL, data = NULL)
|
filename |
A string giving the path to the file containing the raw data. The input file should contain
at least four columns, separated by spaces. Each row gives a link between
two nodes belonging to two different levels of the tripartite graph.
The first column gives the level of the first node (any integer in
{ |
data |
A This |
A properly-structured tripartite graph that can be used by the other functions
of the triversity
package.
The resulting object encodes the names of the nodes at the three levels of the tripartite
graph, as well as the transition matrices of random walks following different paths
between levels (encoded as sparse matrices of floats in [0
,1
], with all
rows summing to 1
). These transition matrices
are then used by functions such as get_distribution_from_path
to
compute the probability distributions of such random walks, or such as
get_diversity_from_path
to compute the diversity of these distributions.
Assuming the object returned by get_tripartite
is stored in the tripartite
variable, then:
tripartite$nodes
is a list of string vectors giving the names of the nodes
constituting the three levels of the tripartite graph
(resp. tripartite$nodes$level1
, tripartite$nodes$level2
, and
tripartite$nodes$level3
).
tripartite$transitions
is a data.tree
whose nodes each contains the
transition matrix of the corresponding random walk. For example,
tripartite$transitions$level1$level2$mat
gives the
transition matrix from level 1 to level 2.
1 2 3 4 5 6 7 | data (tripartite_example)
tripartite <- get_tripartite (data=tripartite_example)
tripartite$nodes$level1
tripartite$nodes$level2
tripartite$level1$level2$mat
tripartite
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.