to_scope {manynet}R Documentation

Modifying networks scope

Description

These functions offer tools for transforming manynet-consistent objects (matrices, igraph, tidygraph, or network objects). Transforming means that the returned object may have different dimensions than the original object.

Usage

to_giant(.data)

to_no_isolates(.data)

to_subgraph(.data, ...)

to_blocks(.data, membership, FUN = mean)

Arguments

.data

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

...

Arguments passed on to dplyr::filter

membership

A vector of partition memberships.

FUN

A function for summarising block content. By default mean. Other recommended options include median, sum, min or max.

Details

Not all functions have methods available for all object classes. Below are the currently implemented S3 methods:

data.frame igraph list matrix network tbl_graph
to_blocks 1 1 0 1 1 1
to_giant 1 1 0 1 1 1
to_no_isolates 1 1 1 1 1 1
to_subgraph 1 1 0 1 1 1

Value

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.

to_blocks()

Reduced graphs provide summary representations of network structures by collapsing groups of connected nodes into single nodes while preserving the topology of the original structures.

See Also

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

Examples

ison_adolescents %>%
  mutate_ties(wave = sample(1995:1998, 10, replace = TRUE)) %>%
  to_waves(attribute = "wave") %>%
  to_no_isolates()

[Package manynet version 1.0.2 Index]