sample_graph | R Documentation |
Simulates network sampling, monitoring and performs community detection based on the simple ratio index.
sample_graph( graph, sample_nNodes, sampling_duration, prop_hi_res = 1, hi_res = 1, lo_res = 1/7, regime = "grab-two", alg = "fast_greedy" )
graph |
The true network to sample. |
sample_nNodes |
The number of individuals to sample. |
sampling_duration |
The number of days to monitor sampled individuals. |
prop_hi_res |
The proportion of sampled nodes to monitor with high resolution. |
hi_res |
The observation frequency of the high resolution individuals, expressed as the number of observations per day. |
lo_res |
The observation frequency of the low resolution individuals, expressed as the number of observations per day. |
regime |
The sampling regime to use: options include "random", "even", "grab-two". |
alg |
The community detection algorithm to use, one of: "netcarto", "fast_greedy", "label_prop", "leiden", "louvain", "walktrap". |
An igraph
graph of the sampled network where edge weights ('attr' = "weight") is the simple ratio index.
g <- simulate_graph(n_animals = 25, n_groups = 4, time_to_leave = 5, time_to_return = 2, travel_time = c(0.001,0.2), sampling_duration = 7, sampler = "discrete", samples_per_day = 1 ) g_obs <- sample_graph( graph = g, sample_nNodes = 10, prop_hi_res = 1, hi_res = 2, sampling_duration = 7, regime = "random", alg = "fast_greedy")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.