rpa_control_newedge {wdnet}R Documentation

Control new edges in each step. Defined for rpanet.

Description

Control new edges in each step. Defined for rpanet.

Usage

rpa_control_newedge(
  sampler = NULL,
  snode.replace = TRUE,
  tnode.replace = TRUE,
  node.replace = TRUE
)

Arguments

sampler

A function used for sampling the number of new edges to be added at each step. If NULL, one new edge will be added at each step. If a function is provided, it must accept a single argument, n, and return a vector of length n that represents the sampled number of new edges.

snode.replace

Logical. Determines whether the source nodes in the same step should be sampled with replacement. Defined for directed networks.

tnode.replace

Logical. Determines whether the target nodes in the same step should be sampled with replacement. Defined for directed networks.

node.replace

Logical. Determines whether the nodes in the same step should be sampled with replacement. Defined for undirected networks. If FALSE, self-loops will not be allowed under beta scenario.

Value

A list of class rpacontrol with components sampler, snode.replace, tnode.replace and node.replace with meanings as explained under 'Arguments'.

Examples

my_rpois <- function(n) rpois(n, lambda = 2) + 1
control <- rpa_control_newedge(
  sampler = my_rpois,
  node.replace = FALSE
)

[Package wdnet version 1.2.3 Index]