These functions offer ways to manipulate network-level data constants or variables that are not tied to a particular node or tie. They include:

  • mutate_globals() adds a table of global variables to the network.

  • rename_globals() renames columns in the global variables table.

  • select_globals() selects columns in the global variables table.

It expects three columns for the variable to which the change applies, which should be called 'var', the time of the change, which should be called 'time', and the new value to be applied, which should be called 'value'.

mutate_globals(.data, ...)

rename_globals(.data, ...)

select_globals(.data, ...)

Arguments

.data

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

...

Additional parameters and arguments passed on internally.

Value

A data object of the same class as the function was given.

Details

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

               data.frame default stocnet
mutate_globals                  *       *
rename_globals          *       *       *
select_globals          *       *       *

If a method is not available for a particular class, but a default method is, the default method will attempt to coerce the object to a class for which a method is defined, and then coerce the output back to the original class. If no method is available for any class, an error will be thrown.

Examples

as_stocnet(ison_algebra) |> 
   mutate_globals(time = 2, var = "active", value = FALSE)
#> 
#> ── # M182 Algebra Class ────────────────────────────────────────────────────────
#> # A multiplex, weighted, directed network of 16 nodes and 279 social arcs, 279
#> tasks arcs, and 279 friends arcs
#> 
#> ── Global 
#> # A tibble: 1 × 3
#>    time var         value
#>   <dbl> <chr>      <list>
#> 1     2 active FALSE<lgl>
#> 
#> ── Ties 
#> # A tibble: 279 × 4
#>    from    to weight layer 
#>   <int> <int>  <dbl> <chr> 
#> 1     1     5   1.2  social
#> 2     1     5   0.3  tasks 
#> 3     1     8   0.15 social
#> 4     1     9   2.85 social
#> 5     1     9   0.3  tasks 
#> 6     1    10   6.45 social
#> # ℹ 273 more rows
#>