Learn R Programming

locationgamer (version 0.1.0)

createDistance: Create distance matrix for a completely connected network

Description

Create distance matrix for a completely connected network

Usage

createDistance(coordMatrix)

Arguments

coordMatrix

A matrix containing all the x and y coordinates of the network vertexes

Value

A square matrix containing the Euclidean distances between all vertexes, assuming that the network is completely connected.

Examples

Run this code
# NOT RUN {
coordMatrix <- matrix(c(0,10,15,20,30,30,15,15),ncol = 2)
createDistance(coordMatrix)

# }

Run the code above in your browser using DataLab