context("erdos graph generation")
library(graphR)
# test --------------------------------------------------------------------
test_that("Returned matrix is symmetric", {
# params
N <- 20
avk <- 4
# generate graph with R
graph <- erdos_matrix(N, avk)
# expect
expect_true(isSymmetric(graph))
})
# test --------------------------------------------------------------------
test_that("Returned matrix is square and of correct size", {
# params
N <- 20
avk <- 4
# generate graph
graph <- erdos_matrix(N, avk)
# rows equal to N
expect_equal(nrow(graph), N)
# cols equal to N
expect_equal(ncol(graph), N)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.