Check whether a matrix fulfills the edgynode adjacency matrix convention
assert_adjacency.Rd
Imports a matrix and tests whether it is an adjacency in edgynode format.
Arguments
- x
a
matrix
object.
Examples
# test with an already clean adjacency matrix
edgynode::assert_adjacency(edgynode::adjacency_clean_test_3)
# 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::assert_adjacency(clean_matrix)