Learn R Programming

SpatialFloor (version 1.1.0)

spatial_dist: Distance matrix calculation

Description

This function load grid floor and generate the distance matrix

Usage

spatial_dist(M, lon.lat = F, mile = F)

Arguments

M

A data.frame contains grid coordinates

lon.lat

If TRUE, the function will use longitude and latitude for calculating geographic distance

mile

If TRUE, the function will yeild distance in mileages. If FALSE, the function will yeild distance in kilometers

Value

A matrix of distance matrix

Examples

Run this code
# NOT RUN {
spatial_dist(expand.grid(1:4, 1:4))
# }

Run the code above in your browser using DataLab