adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
# With cograph()
p <- cograph(adj) |> sn_ggplot()
print(p)
# Direct matrix input
p <- adj |> sn_ggplot()
# Further customization
p + ggplot2::labs(title = "My Network")
Run the code above in your browser using DataLab