Dist_mat_edge: Clustered edge population distribution.

Description Usage Arguments Value Examples

View source: R/Dist_mat_edge.R

Description

This function generates a distance matrix for a population that is clustered on the left and right edges of the space only.

Usage

1
Dist_mat_edge(N, xlim = 20, ylim = 20, clusters = 8)

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).

clusters

The total number of clusters. Half the clusters will be on the right edge, the other half on the left. (Must be even, greater than 2, and divide N). Clusters are generated on blocks of size (xlim/10, ylim/10).

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

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