inst/unitTests/test_rgraphBAM.R

## http://www.johnmyleswhite.com/notebook/2010/08/17/unit-testing-in-r-the-bare-minimum/
## checkEquals: Are two objects equal, including named attributes?
## checkEqualsNumeric: Are two numeric values equal?
## checkIdentical: Are two objects exactly the same?
## checkTrue: Does an expression evaluate to TRUE?
## checkException: Does an expression raise an error?

## rgraphBAM()
test_rgraphBAM <- function() {

  ## check that random d-regular graphs have a constant degree
  set.seed(1234)
  g <- rgraphBAM(dRegularMarkedGraphParam(pI=2, pY=10, d=3))
  d <- graph::degree(g)
  checkIdentical(unique(d), 3)
}

Try the qpgraph package in your browser

Any scripts or data that you put into this service are public.

qpgraph documentation built on Jan. 10, 2021, 2:01 a.m.