focal_sample: Performs a focal-scan sampling over a 'scanList' object...

Description Usage Arguments Value See Also

View source: R/expDesign_sampling.R

Description

Performs a focal-scan sampling over a scanList object Internal.

Usage

1
2
3
4
5
focal_sample(
  scan.list,
  sampling = c("even", "random", "function"),
  all.sampled = TRUE
)

Arguments

scan.list

a scanList object

sampling

for method = "focal, users should input either:

  • a character scalar: for common sampling regimes:

    • "even": select focals as evenly as possible, and the extra scans uniformly

    • "random": uniform probability of choosing a focal at each scan

  • a user-defined function ("function"): a function of the adjacency matrix Adj (can be named anything) that returns a vector of the probabilities of choosing a focal node at each scan

  • WIP: more option to be added, like with the possibility to pass a focalList object directly

all.sampled

logical scalar, should all nodes be sampled at least once? (TO CHECK: does it work with group-scan sampling?)

Value

an empirical scanList object in which, compared to the theoretical.scanList (added to attrs), edges not involving the scan's focal are replaced by NAs (regardless of them being 0 or 1).

Returned scanList has new attributes added to attrs:

See Also

design_sampling(), draw_focalList().


R-KenK/SimuNet documentation built on Oct. 22, 2021, 1:27 a.m.