add_ties {manynet}R Documentation

Modifying tie data

Description

These functions allow users to add and delete ties and their attributes:

Note that while ⁠add_*()⁠/⁠delete_*()⁠ functions operate similarly as comparable {igraph} functions, ⁠mutate*()⁠, ⁠bind*()⁠, etc work like {tidyverse} or {dplyr}-style functions.

Usage

add_ties(.data, ties, attribute = NULL)

delete_ties(.data, ties)

add_tie_attribute(.data, attr_name, vector)

mutate_ties(.data, ...)

rename_ties(.data, ...)

arrange_ties(.data, ...)

bind_ties(.data, ...)

join_ties(.data, object2, attr_name)

filter_ties(.data, ...)

select_ties(.data, ...)

summarise_ties(.data, ...)

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

ties

The number of ties to be added or an even list of ties.

attribute

A named list to be added as tie or node attributes.

attr_name

Name of the new attribute in the resulting object.

vector

A vector of values for the new attribute.

...

Additional arguments.

object2

A second object to copy nodes or ties from.

Value

A tidygraph (tbl_graph) data object.

See Also

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

Examples

  other <- create_filled(4) %>% mutate(name = c("A", "B", "C", "D"))
  mutate_ties(other, form = 1:6) %>% filter_ties(form < 4)
  add_tie_attribute(other, "weight", c(1, 2, 2, 2, 1, 2))

[Package manynet version 1.0.2 Index]