Learn R Programming

SDDE (version 1.0.0)

sample_path: 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.

encoding

ISO-8859-2

Examples

Run this code
## Draw 5 samples of 10 pathways out of 100 nodes without repeated pathways
	old_path <- c();
		for (i in 1:5) {
		r <- sample_path(10,100, old_path);
			old_path <- c(old_path, r);
		}

Run the code above in your browser using DataLab