Learn R Programming

cartograflow (version 1.0.0)

flowdist: Compute continous distance matrix from geographical background

Description

From a geographical background computes (and threshold) a distance matrix.

Usage

flowdist(tab, dist.method, result)

Arguments

tab

the input flow dataset.

dist.method

euclidian calculation

result

take the vallue "flowdist" or "dist" allows to parameter the resulting distance dataset (flows filtered by a distance criterion or not)

Value

(1) A flowdata set with continuous euclidian distances calculations, see dist.method parameter

(2) A flowdata set with movement from euclidian distances calculations.

(3) A flowmap filtered by a global distance criterion.

Details

-- result = "dist" is the resulting tab of the distance -- result = "flowdist" with all the calculated parameters

Examples

Run this code
# NOT RUN {
library(cartograflow)
data(flowdata)
bkg<- system.file("shape/MGP_TER.shp", package="cartograflow",
                  lib.loc = NULL, mustWork = TRUE)
tab<-flowjointure(flows,bkg,"EPT_NUM")
#Format long with only origin, destination and distance parameters:
tab.distance<-flowdist(tab, dist.method = "euclidian",result = "dist")
#Format long with with all parameters: coordinates, distance, mouvement
tab.distance<-flowdist(tab, dist.method = "euclidian",result = "flowdist")
# }

Run the code above in your browser using DataLab