Check if the network is directed
is_directed(x)
logical, TRUE
or FALSE
This function checks if x
is a directed network.
For an x of class igraph
or network
, the function checks
for the appropriate attribute in the graph x.
For a matrix
the function returns TRUE
if the matrix is
not symmetric.
For a data.frame
the function returns TRUE
if the reciprocity
of the network is not exactly 0 or 1.
largely based on similar functions from the excellent
migraph
package.
These methods are licensed through the
MIT license
in combination with copyright for James Hollway.
data(florentine, package = "snafun")
is_weighted(florentine$flobusiness) # FALSE
#> [1] FALSE