knitr::opts_chunk$set(collapse = T, comment = "#>", warning = FALSE, message = FALSE, fig.align = "center") options(tibble.print_min = 4L, tibble.print_max = 4L)
Since each generator function expects the graph object as its first argument one can make use of the fantastic magrittr pipes to improve reading. See the documentation of the magrittr package for details on the forward-pipe operator.
library(grapherator) library(magrittr) set.seed(1) # reproducability g = graph(lower = 0, upper = 10) %>% addNodes(n = 20, generator = addNodesUniform) %>% addEdges(generator = addEdgesComplete) %>% addWeights(generator = addWeightsRandom, method = runif, min = 5, max = 10) %>% addWeights(generator = addWeightsRandom, method = runif, min = 5, max = 10) print(g) do.call(gridExtra::grid.arrange, c(plot(g), list(nrow = 1)))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.