These functions allow users to add and edit information about the network
itself.
Where available, this information is printed for tidygraph-class objects,
and can be used for printing a grand table in the {grand} package.
add_info() adds information attributes to the network.
mutate_info() updates information attributes of the network.
net_attributes() lists the information attributes of the network.
add_info(.data, ...)
mutate_info(.data, ...)
net_attributes(.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
Named attributes. The following are currently recognised:
"name" is the name of the network
"modes" is the name(s) of the nodeset(s)
"layers" is the name(s) of the tie type(s)
"directed" is a logical vector indicating whether each layer is directed
"source" is the source of the network ("empirical" or "synthetic")
"method" is the method of data collection or model used (e.g. "survey", "interview","sensor","observation","archival", or "simulation")
"location" is the geographic, institutional, or digital location of the network
"date" is the date of data collection or model run
"boundary" is the boundary specification of the network ("ego", "roster", or "snowball")
"observation" is the observation type of the network ("cross-sectional", "panel", or "event")
"update" is the update type of the network ("increment" or "replace")
"max_degree" is the maximum degree of the network
"min_degree" is the minimum degree of the network
"doi" is the DOI or URL of the network
"transformations" records how the network has been transformed since it was collected or generated. See the Transformations section. Note that this records what has been done to the network, where "method" records how the network was collected or modelled.
If no arguments are used,
the function will check for missing information and prompt the user to add it.
If optional = TRUE is specified, the function will also prompt for optional information.
A data object of the same class as the function was given.
Not all functions have methods available for all object classes. Below are the currently implemented S3 methods for these functions:
data.frame default igraph matrix network stocnet tbl_graph
add_info * * *
as_infolist * * * * * *
mutate_info * * *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.
The "transformations" field implements section 4 of the GRAND guidelines, which names six ways raw data is turned into analytic data. It holds a named list, one element for each of them:
"symmetrisation" (GRAND 4.1), which to_undirected() sets.
"dichotomisation" (4.2), which to_unweighted() sets.
"projection" (4.3), which to_mode1() and to_mode2() set.
"exclusion" (4.4), which the functions that drop nodes or ties set,
such as delete_isolates(), to_component(), and to_uniplex().
"aggregation" (4.5), which to_flat(), join_ties(),
and to_blockmodel() set.
"imputation" (4.6), which impute_ties() and impute_nodes() set.
One further name, "normalisation", records what to_normalised() does.
The guidelines do not name it, since rescaling tie values neither
dichotomises them (4.2 ends in an unweighted network)
nor aggregates them (4.5 combines what was separate),
but it changes the analytic network and so is recorded too.
A name that is absent means that transformation was not applied,
so "symmetrisation" %in% names(as_infolist(.data)$transformations)
answers whether a network was symmetrised
without reading past everything else done to it.
describe_transformations() reports the same thing as a phrase.
Each element is a character vector naming the method first,
and, where the guidelines ask for an amount too,
its consequence in parentheses:
list(symmetrisation = "collapse", imputation = "reciprocity (73 missing ties)").
An element accumulates rather than replaces,
so a network imputed in more than one step reports each of them,
and the order of the names is the order the transformations were applied.
The to_*() and impute_*() functions set this themselves,
so it rarely needs to be set by hand.
Where it does, add_info() takes a named list and merges it in,
and refuses a name that is not one of those above.
GRAND statement for more information on the Guidelines for Reporting About Network Data (GRAND).
Other manipulations:
manip_changes,
manip_globals,
manip_nodes_attr,
manip_nodes_num,
manip_ties_attr,
manip_ties_num
add_info(ison_algebra, name = "Algebra")
#>
#> ── # Algebra ───────────────────────────────────────────────────────────────────
#> # A multiplex, weighted, directed network of 16 nodes and 129 social arcs, 88
#> task arcs, and 62 friendship arcs
#>
#> ── Ties
#> # A tibble: 279 × 4
#> from to type weight
#> <int> <int> <chr> <dbl>
#> 1 1 5 social 1.2
#> 2 1 5 tasks 0.3
#> 3 1 8 social 0.15
#> 4 1 9 social 2.85
#> 5 1 9 tasks 0.3
#> 6 1 10 social 6.45
#> # ℹ 273 more rows
#>