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:
matrix (adjacency or incidence) from {base}
R
edgelist, a data frame from {base}
R or tibble from {tibble}
igraph, from the {igraph}
package
network, from the {network}
package
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.
All to_
functions return an object of the same class as that provided.
So passing it an igraph object will return an igraph object
and passing it a network object will return a network object,
with certain modifications as outlined for each function.
Not all functions have methods available for all object classes. Below are the currently implemented S3 methods:
data.frame | igraph | matrix | network | tbl_graph | |
to_mode1 | 1 | 1 | 1 | 1 | 1 |
to_mode2 | 1 | 1 | 1 | 1 | 1 |
to_ties | 1 | 1 | 1 | 1 | 1 |
Other modifications:
manip_as
,
manip_correlation
,
manip_deformat
,
manip_from
,
manip_levels
,
manip_miss
,
manip_nodes
,
manip_paths
,
manip_permutation
,
manip_preformat
,
manip_reformat
,
manip_scope
,
manip_split
,
manip_ties
to_mode1(ison_southern_women)
#>
#> ── # Southern Women Data ───────────────────────────────────────────────────────
#> # A labelled, weighted, undirected network of 18 women and 139 participation
#> 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)
#> ── # Southern Women Data ───────────────────────────────────────────────────────
#> # A labelled, weighted, undirected network of 14 women and 66 participation
#> 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
#>
#graphr(to_mode1(ison_southern_women))
#graphr(to_mode2(ison_southern_women))
to_ties(ison_adolescents)
#> ── # Line graph ────────────────────────────────────────────────────────────────
#> # A labelled, undirected network of 10 nodes and 20 ties
#>
#> ── Nodes
#> # A tibble: 10 × 1
#> name
#> <chr>
#> 1 Betty-Sue
#> 2 Sue-Alice
#> 3 Alice-Jane
#> 4 Sue-Dale
#> 5 Alice-Dale
#> 6 Jane-Dale
#> # ℹ 4 more rows
#>
#> ── Ties
#> # A tibble: 20 × 2
#> from to
#> <int> <int>
#> 1 1 2
#> 2 2 3
#> 3 1 4
#> 4 2 4
#> 5 4 5
#> 6 2 5
#> # ℹ 14 more rows
#>
#graphr(to_ties(ison_adolescents))