These functions implement logical tests for various network properties.
All is_*() functions return a logical scalar (TRUE or FALSE).
is_twomode() marks networks TRUE if they contain two sets of nodes.
is_weighted() marks networks TRUE if they contain tie weights.
Note that signed networks often hold their signs as weights of -1 and 1,
so that no sign is lost when coercing between formats;
since such a 'weight' records only the sign of each tie,
these networks are marked FALSE unless the weights vary in magnitude.
is_directed() marks networks TRUE if the ties specify which node
is the sender and which the receiver.
A two-mode network can be directed too, for example where its ties run
from speakers to the concepts they claim.
A two-mode matrix cannot record direction, however,
so it is always marked FALSE, and an edgelist whose two-mode ties all
run one way is marked FALSE too, since it cannot say otherwise.
is_labelled() marks networks TRUE if there is a 'names' attribute
for the nodes.
is_attributed() marks networks TRUE if there are other nodal attributes
than 'names' or 'type'.
is_signed() marks networks TRUE if the ties can be either positive
or negative.
This is the case where the ties have a 'sign' attribute,
and also where they are weighted and any of those weights are negative.
is_complex() marks networks TRUE if any ties are loops,
with the sender and receiver being the same node.
is_multiplex() marks networks TRUE if it contains multiple types
of ties, such that there can be multiple ties between the same
sender and receiver.
This is the case where the ties have a 'layer' (or 'type') attribute.
Other tie attributes, such as a covariate, do not make a network multiplex.
is_uniplex() marks networks TRUE if it is neither complex nor multiplex.
is_disaggregated() marks networks TRUE if any of their ties are
parallel, as tie_is_parallel() marks them, so that
to_aggregated(over = NULL) can combine them.
A network marked FALSE holds no parallel ties, which does not mean that
it was aggregated.
is_weighted(.data)
is_directed(.data)
is_signed(.data)
is_complex(.data)
is_multiplex(.data)
is_disaggregated(.data)
is_uniplex(.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
Not all functions have methods available for all object classes. Below are the currently implemented S3 methods for these functions:
data.frame default igraph list matrix network stocnet
is_complex * * * * * * *
is_directed * * * * * *
is_disaggregated *
is_multiplex * * * * * *
is_signed * * * * * *
is_uniplex * *
is_weighted * * * * * *
layer_is_directed * * *
tbl_graph
is_complex *
is_directed *
is_disaggregated
is_multiplex *
is_signed *
is_uniplex
is_weighted *
layer_is_directedIf 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.
Other marks:
mark_format_change,
mark_format_cognitive,
mark_format_node
is_weighted(create_tree(3))
#> [1] FALSE
is_directed(create_tree(2))
#> [1] FALSE
is_directed(create_tree(2, directed = TRUE))
#> [1] TRUE
is_signed(create_lattice(3))
#> [1] FALSE
is_complex(create_lattice(4))
#> [1] FALSE
is_multiplex(create_filled(c(3,3)))
#> [1] FALSE
is_disaggregated(ison_koenigsberg)
#> [1] TRUE
is_uniplex(create_star(3))
#> [1] TRUE