context("graphing utility functions")
library(graphR)
# test --------------------------------------------------------------------
test_that("list2matrix and matrix2list functions works correctly", {
# params
N <- 20
avk <- 4
# generate graphs
set.seed(1)
graph_matrix <- erdos_matrix(N, avk)
set.seed(1)
graph_list <- erdos_list(N, avk)
tmp_list <- matrix2list(graph_matrix)
tmp_matrix <- list2matrix(graph_list)
# expect
expect_equal(graph_matrix, tmp_matrix)
expect_equal(graph_list, tmp_list)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.