These functions offer tools for projecting manynet-consistent data:
to_mode1() projects a two-mode network to a one-mode network
of the first node set's (e.g. rows) joint affiliations to nodes in the second node set (columns).
to_mode2() projects a two-mode network to a one-mode network
of the second node set's (e.g. columns) joint affiliations to nodes in the first node set (rows).
to_ties() projects a network to one where the ties become nodes and incident nodes become their ties.
An object of a {manynet}-consistent class:
adjacency or incidence matrix from {base} R
edgelist data.frame from {base} R or tbl/tbl_df from {tibble}
stocnet stocnet, from the {manynet} package
igraph igraph, from the {igraph} package
network network, from the {network} package
tidygraph tbl_graph, from the {tidygraph} package
Method for establishing ties, currently "count" (default), "jaccard", or "rand".
"count" calculates the number of coinciding ties, and can be interpreted as indicating the degree of opportunities between nodes.
"jaccard" uses this count as the numerator in a proportion, where the denominator consists of any cell where either node has a tie. It can be interpreted as opportunity weighted by participation.
"rand", or the Simple Matching Coefficient, is a proportion where the numerator consists of the count of cells where both nodes are present or both are absent, over all possible cells. It can be interpreted as the (weighted) degree of behavioral mirroring between two nodes.
"pearson" (Pearson's coefficient) and "yule" (Yule's Q) produce correlations for valued and binary data, respectively. Note that Yule's Q has a straightforward interpretation related to the odds ratio.
A tidygraph object modified as explained in the function description, details, or section.
Not all functions have methods available for all object classes. Below are the currently implemented S3 methods:
| Category | Feature | manynet::to_mode1()/to_mode2() | igraph::bipartite_projection() | network/sna manual |
| Input | Dedicated function | yes | yes | no |
| Accepted input classes | igraph, network, tidygraph, matrix, edgelist | igraph only | any (manual extraction) | |
| Detects mode membership from | mode node attribute | type vertex attribute | bipartite network attr (positional) | |
| Projection | Returns both projections at once | no — one per call | yes — list of two | two manual calls |
| Projects mode 1 (actors) | to_mode1() | which = "true" | A %*% t(A) | |
| Projects mode 2 (events) | to_mode2() | which = "false" | t(A) %*% A | |
| Weights | Raw co-membership counts | yes | yes (multiplicity = TRUE) | yes |
| Binary (unweighted) output | yes | yes (multiplicity = FALSE) | threshold manually | |
| Jaccard normalisation | yes | no | code manually | |
| Cosine normalisation | yes | no | code manually | |
| Attributes | Retains node attributes | yes | yes | no — lost in matrix round-trip |
| Retains edge attributes | weight only | weight only | no | |
| Removes self-loops automatically | yes | yes | diag(P) <- 0 manually | |
| Output | Output class matches input | yes | no | no |
| Directed projection support | limited | no — undirected only | yes — asymmetric matrix | |
| Usability | Lines of code (basic case) | 1 | 1 | 4–6 |
| Lines of code (Jaccard weights) | 1 | ~8 manual | ~8 manual | |
| Pipe-friendly | yes | with wrappers | no |
Other modifications:
modif_correlation,
modif_direction,
modif_from,
modif_labels,
modif_levels,
modif_miss,
modif_paths,
modif_permutation,
modif_plexity,
modif_scope,
modif_split,
modif_weight
to_mode1(ison_southern_women)
#>
#> ── # Projection of Southern Women Data ─────────────────────────────────────────
#> # A labelled, weighted, undirected network of 18 womens and 139 co-social
#> events ties
#>
#> ── Nodes
#> # A tibble: 18 × 3
#> name Surname Title
#> <chr> <chr> <chr>
#> 1 Evelyn Jefferson Mrs
#> 2 Laura Mandeville Miss
#> 3 Theresa Anderson Miss
#> 4 Brenda Rogers Miss
#> 5 Charlotte McDowd Miss
#> 6 Frances Anderson Miss
#> # ℹ 12 more rows
#>
#> ── Ties
#> # A tibble: 139 × 3
#> from to weight
#> <int> <int> <dbl>
#> 1 1 2 6
#> 2 1 4 6
#> 3 1 3 7
#> 4 1 5 3
#> 5 1 6 4
#> 6 1 7 3
#> # ℹ 133 more rows
#>
to_mode2(ison_southern_women)
#> ── # Projection of Southern Women Data ─────────────────────────────────────────
#> # A labelled, weighted, undirected network of 14 social events and 66 co-women
#> ties
#>
#> ── Nodes
#> # A tibble: 14 × 3
#> name Surname Title
#> <chr> <chr> <chr>
#> 1 E1 6/27 NA
#> 2 E2 3/2 NA
#> 3 E3 4/12 NA
#> 4 E4 9/26 NA
#> 5 E5 2/25 NA
#> 6 E6 5/19 NA
#> # ℹ 8 more rows
#>
#> ── Ties
#> # A tibble: 66 × 3
#> from to weight
#> <int> <int> <dbl>
#> 1 1 2 2
#> 2 1 3 3
#> 3 1 4 2
#> 4 1 5 3
#> 5 1 6 3
#> 6 1 8 3
#> # ℹ 60 more rows
#>
to_ties(ison_adolescents)
#> IGRAPH 0ff62e7 UN-- 10 20 -- Line graph
#> + attr: name (g/c), name (v/c)
#> + edges from 0ff62e7 (vertex names):
#> [1] Betty-Sue --Sue-Alice Sue-Alice --Alice-Jane Betty-Sue --Sue-Dale
#> [4] Sue-Alice --Sue-Dale Sue-Dale --Alice-Dale Sue-Alice --Alice-Dale
#> [7] Alice-Jane--Alice-Dale Sue-Dale --Jane-Dale Alice-Dale--Jane-Dale
#> [10] Alice-Jane--Jane-Dale Betty-Sue --Sue-Pam Sue-Alice --Sue-Pam
#> [13] Sue-Dale --Sue-Pam Sue-Pam --Alice-Pam Sue-Alice --Alice-Pam
#> [16] Alice-Jane--Alice-Pam Alice-Dale--Alice-Pam Sue-Pam --Pam-Carol
#> [19] Alice-Pam --Pam-Carol Pam-Carol --Carol-Tina