context("Optimize node sizes")
test_that("optimize_sizes", {
nodes_edges <- nodes_edges()
result <- optimize_sizes(nodes_edges$nodes, nodes_edges$edges)
expected <- structure(
rep(1, nrow(nodes_edges$nodes)),
names = nodes_edges$nodes[,1]
)
expected["draw.nodes"] <- 3
expected["sankey"] <- 15
expected["ypos_present"] <- 2
expected["par"] <- 2
expect_equal(result, expected)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.