plot_sampled_graph: Plot Graph of Sampled Network

View source: R/plot_sampled_graph.R

plot_sampled_graphR Documentation

Plot Graph of Sampled Network

Description

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.

Usage

plot_sampled_graph(
  g_obs,
  g,
  vertex.size = 40,
  mark.expand = 25,
  vertex.label = NA,
  vertex.label.cex = 1.5,
  title = "",
  seed = NULL
)

Arguments

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

Value

a plot of the sampled graph

Examples


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)


gavincotterill/modulr documentation built on Nov. 30, 2022, 11:15 p.m.