Dist_mat_unif: Uniform population distribution.

Description Usage Arguments Value Examples

View source: R/Dist_mat_unif.R

Description

This function generates a distance matrix with uniform distribution of individuals across a specified rectangle.

Usage

1
Dist_mat_unif(N, xlim = 20, ylim = 20)

Arguments

N

The total number of individuals in the population.

xlim

The width of the plane on which individuals will be generated (defaults to 20 units wide).

ylim

The height of the place on which individuals will be generated (defaults to 20 units high).

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_unif(N=100, xlim = 20, ylim = 20)[[1]]
distance_mat <- Dist_mat_unif(N=100, xlim = 20, ylim = 20)[[2]]
plot(xy.coords[,1], xy.coords[,2], type  = "p")

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