Dist_mat_trials: Multiple lines population distribution.

Description Usage Arguments Value Examples

View source: R/Dist_mat_trials.R

Description

This function generates a distance matrix where the population is arranged on seperate lines where the gaps between rows increase by one unit with each successive individual. The multiple lines are far apart and can be thought of as multiple trials of a 2D epidemic, if the first individual in every row is an initial infective.

Usage

1
Dist_mat_trials(N, nline)

Arguments

N

The total number of individuals in the population.

nline

The number of lines(trials). Must divide N.

Value

The function returns a list. The first object in the list is a Nx2 matrix of the coordinates of the individuals. The second object is an NxN distance matrix.

Examples

1
2
3
xy.coords <- Dist_mat_trials(N=100, nline = 10)[[1]]
distance_mat <- Dist_mat_trials(N=100, nline = 10)[[2]]
plot(xy.coords[,1], xy.coords[,2], type  = "p")

BenjamenSimon/EpidemicR documentation built on March 23, 2020, 11:03 p.m.