R: is a helper function that creates a vector of non-repeating...
sample_path
R Documentation
is a helper function that creates a vector of non-repeating pathways to investigate
Description
This internal function create a randomized vector of paired node numbers of a given length without repeat.
Usage
sample_path(n, max_len, old_path)
Arguments
n
the number of pathways
max_len
the total number of nodes
old_path
vector of already sampled pairs of node numbers
Value
This function return a randomize vector of 2 x n node numbers.
Examples
## Draw 5 samples of 10 pathways out of 100 nodes without repeated pathways
## Not run:
old_path <- c();
for (i in 1:5) {
r <- sample_path(10,100, old_path);
old_path <- c(old_path, r);
}
## End(Not run)