Dist_mat_lines: Spreading lines population distribution.

Description Usage Arguments Value Examples

View source: R/Dist_mat_lines.R

Description

This function generates a distance matrix where the population is arranged on a lattice where the gaps between rows and columns increases by one unit with each successive individual.

Usage

1

Arguments

N

The total number of individuals in the population.(Must be a square number).

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_lines(N=100)[[1]]
distance_mat <- Dist_mat_lines(N=100)[[2]]
plot(xy.coords[,1], xy.coords[,2], type  = "p")

IanniMuliterno/EpidemicR documentation built on Oct. 30, 2019, 7:18 p.m.