Learn R Programming

SimInf (version 5.1.0)

distance_matrix: Create distance matrix

Description

Calculate the euclidian distances beween coordinates for all coordinates within the cutoff.

Usage

distance_matrix(x, y, cutoff, min_dist = NULL)

Arguments

x

Projected x coordinate

y

Projected y coordinate

cutoff

The distance cutoff

min_dist

The minimum distance to separate two nodes. If the coordinates for two nodes are identical, the min_dist must be assigned or an error is raised. Default is NULL i.e. to raise an error.

Value

dgCMatrix

Examples

Run this code
# NOT RUN {
distance_matrix(1:10, 1:10, 3)
# }

Run the code above in your browser using DataLab