View source: R/plot_sampled_graph.R
plot_sampled_graph | R Documentation |
Takes a graph from sample_graph and plots it to match plot_simulated_graph. If optional seed is set to match across the two functions, node position is preserved.
plot_sampled_graph( g_obs, g, vertex.size = 40, mark.expand = 25, vertex.label = NA, vertex.label.cex = 1.5, title = "", seed = NULL )
g_obs |
an igraph object output from sample_graph() |
g |
an igraph object output from simulate_graph() or graph_from_schedule() |
vertex.size |
node size in plot |
mark.expand |
padding of polygon denoting modules around nodes |
vertex.label |
label for graph vertices |
vertex.label.cex |
size for vertex labels |
title |
plot title |
seed |
optional integer value to set.seed() within function and preserve node layout when plotting sampled and simulated graphs |
a plot of the sampled graph
g <- simulate_graph(n_animals = 25, n_groups = 4, time_to_leave = 5, time_to_return = 2, travel_time = c(0.001, 0.2), samples_per_day = 1, sampling_duration = 7) g_obs <- sample_graph( graph = g, sample_nNodes = 13, prop_hi_res = 1, hi_res = 2, regime = "grab-two", alg = "fast_greedy", sampling_duration = 7) plot_sampled_graph(g_obs, g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.