Sets the layout coordinates in a cograph_network object. Updates the x and y columns in the nodes data frame.
Examples
mat <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
net <- as_cograph(mat)
layout <- data.frame(x = c(0, 1, 0.5), y = c(0, 0, 1))
net <- set_layout(net, layout)
get_nodes(net)
#> id label name x y
#> 1 1 1 1 0.0 0
#> 2 2 2 2 1.0 0
#> 3 3 3 3 0.5 1