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_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_egonet() marks networks TRUE if it is a list of networks where each network contains only one node and its ties.

is_twomode(.data)

is_labelled(.data)

is_attributed(.data)

is_egonet(.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

Details

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 numeric stocnet
is_attributed                  *
is_egonet                      *
is_labelled            *       *      *    *      *       *               *
is_twomode             *       *      *    *      *       *       *       *
              tbl_graph
is_attributed
is_egonet
is_labelled           *
is_twomode            *

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

is_twomode(create_filled(c(2,2)))
#> [1] TRUE
is_labelled(create_empty(3))
#> [1] FALSE
is_attributed(ison_algebra)
#> [1] FALSE
is_egonet(fict_starwars)
#> [1] FALSE