Learn R Programming

stplanr (version 0.1.4)

points2odf: Convert a series of points into a dataframe of origins and destinations

Description

Takes a series of geographical points and converts them into a data.frame representing the potential flows, or 'spatial interaction', between every combination of points.

Usage

points2odf(p)

Arguments

p
SpatialPointsDataFrame or data.frame

Examples

Run this code
df <- points2odf(cents)
cents_centroids <- rgeos::gCentroid(cents, byid = TRUE)
df2 <- points2odf(cents_centroids)

Run the code above in your browser using DataLab