/usr/lib/R/site-library/igraph/tests/test_graph.density.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 | context("graph.density")
test_that("graph.density works", {
library(igraph)
g <- erdos.renyi.game(50, 4/50)
gd <- graph.density(g)
gd2 <- ecount(g) / vcount(g) / (vcount(g)-1) * 2
expect_that(gd, equals(gd2))
####
g <- erdos.renyi.game(50, 4/50, dir=TRUE)
gd <- graph.density(g)
gd2 <- ecount(g) / vcount(g) / (vcount(g)-1)
expect_that(gd, equals(gd2))
})
|