These functions implement logical tests for networks' classes.
is_manynet() marks a network TRUE if it is compatible with {manynet} functions.
is_edgelist() marks a network TRUE if it is an edgelist.
is_graph() marks a network TRUE if it contains graph-level information.
is_list() marks a network TRUE if it is a (non-igraph) list of networks,
for example a set of ego networks or a dynamic or longitudinal set of networks.
is_longitudinal() marks a network TRUE if it contains longitudinal, panel data.
is_dynamic() marks a network TRUE if it contains dynamic, time-stamped data.
is_changing() marks a network TRUE if it contains changes to nodal attributes.
All is_*() functions return a logical scalar (TRUE or FALSE).
is_manynet(.data)
is_graph(.data)
is_edgelist(.data)
is_list(.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
TRUE if the condition is met, or FALSE otherwise.
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 tbl_graph
is_edgelist * *
is_graph * * * * *
is_list * *
is_manynet * * * * * * *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.
Other marking:
mark_features
is_manynet(create_filled(2))
#> [1] TRUE
is_graph(create_star(2))
#> [1] TRUE
is_edgelist(matrix(c(2,2), 1, 2))
#> [1] FALSE
is_edgelist(as_edgelist(matrix(c(2,2), 1, 2)))
#> [1] TRUE