Skip to contents

Tests whether a matrix is an adjacency in edgynode format.

Usage

is_adjacency(x)

Arguments

x

a matrix object.

Value

The result of the test (TRUE/FALSE)

Author

Ilias Moutsopoulos and Hajk-Georg Drost

Examples

# test with an already clean adjacency matrix
edgynode::is_adjacency(edgynode::adjacency_clean_test_3)
#> [1] TRUE
# look at raw matrix
edgynode::adjacency_matrix_test_3
#>      [,1] [,2] [,3]
#> [1,]    0   -1    2
#> [2,]    1    2    4
#> [3,]    4    0    0
# convert raw matrix into a edgynode adjacency matrix
clean_matrix <- edgynode::make_adjacency(edgynode::adjacency_matrix_test_3)
# test converted matrix
edgynode::is_adjacency(clean_matrix)
#> [1] TRUE