test_that("dyad census attr works", {
library(igraph)
gundir <- make_full_graph(3, directed = FALSE)
gnoatt <- make_full_graph(3, directed = TRUE)
gchatt <- make_full_graph(3, directed = TRUE)
vertex_attr(gchatt, "test") <- c("a", "b", "c")
gattr <- make_full_graph(3, directed = TRUE)
vertex_attr(gattr, "test") <- c(1, 2, 3)
expect_error(dyad_census_attr(gundir))
expect_error(dyad_census_attr(gnoatt))
expect_error(dyad_census_attr(gchatt, "test"))
expect_equal(dyad_census_attr(gattr, "test")$sym, c(0, 1, 1, 0, 1, 0))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.