/usr/lib/R/site-library/igraph/tests/test_degree.sequence.game.R is in r-cran-igraph 0.7.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | context("degree.sequence.game")
test_that("degree.sequence.game works", {
library(igraph)
gc <- function(graph) {
clu <- clusters(graph)
induced.subgraph(graph, which(clu$membership==which.max(clu$csize)))
}
g <- gc(erdos.renyi.game(1000, 2/1000))
nG <- degree.sequence.game(degree(g), method="simple")
expect_that(degree(nG), equals(degree(g)))
nG <- degree.sequence.game(degree(g), method="vl")
expect_that(degree(nG), equals(degree(g)))
expect_that(is.connected(nG), is_true())
expect_that(is.simple(nG), is_true())
#####
g <- erdos.renyi.game(1000, 1/1000)
nG <- degree.sequence.game(degree(g), method="simple")
expect_that(degree(nG), equals(degree(g)))
g2 <- erdos.renyi.game(1000, 2/1000, dir=TRUE)
nG2 <- degree.sequence.game(degree(g, mode="out"),
degree(g, mode="in"),
method="simple")
expect_that(degree(nG, mode="out"), equals(degree(g, mode="out")))
expect_that(degree(nG, mode="in"), equals(degree(g, mode="in")))
})
|