from {manynet}R Documentation

Joining lists of networks, graphs, and matrices

Description

These functions offer tools for joining lists of manynet-consistent objects (matrices, igraph, tidygraph, or network objects) into a single object.

Usage

from_subgraphs(netlist)

from_egos(netlist)

from_waves(netlist)

from_slices(netlist, remove.duplicates = FALSE)

from_ties(netlist, netnames)

Arguments

netlist

A list of network, igraph, tidygraph, matrix, or edgelist objects.

remove.duplicates

Should duplicates be removed? By default FALSE. If TRUE, duplicated edges are removed.

netnames

A character vector of names for the different network objects, if not already named within the list.

Value

A tidygraph object combining the list of network data.

See Also

Other modifications: add_nodes(), add_ties(), as(), correlation, miss, reformat, split(), to_levels, to_paths, to_project, to_scope

Examples

ison_adolescents %>%
  mutate(unicorn = sample(c("yes", "no"), 8, replace = TRUE)) %>%
  to_subgraphs(attribute = "unicorn") %>%
  from_subgraphs()
ison_adolescents %>%
  to_egos() %>%
  from_egos()
ison_adolescents %>%
  mutate_ties(wave = sample(1:4, 10, replace = TRUE)) %>%
  to_waves(attribute = "wave") %>%
  from_waves()
ison_adolescents %>%
  mutate_ties(time = 1:10, increment = 1) %>% 
  add_ties(c(1,2), list(time = 3, increment = -1)) %>% 
  to_slices(slice = c(5,7)) %>%
  from_slices()

[Package manynet version 1.0.2 Index]