[R-sig-Geo] matrix distances

jeremy.raw at dot.gov jeremy.raw at dot.gov
Wed Aug 25 16:55:09 CEST 2010


There are a two ways that I am aware of to generate a matrix of point-to-point distances computed by traversing a network of roads:

1. One well-tested and reasonably fast solution is the igraph package on CRAN, using the shortest.paths function

2. There is a more specialized (and still experimental) package on R-Forge called travelr (of which I am the primary author) that is designed to support traffic assignment applications (http://r-forge.r-project.org/projects/travelr).  There is more setup involved than with igraph, but the tradeoff is that it is easier to get at the results that typically matter for travel demand models.

Neither of these approaches works seamlessly with R spatial objects (it's on the agenda for travelr), but it's straightforward to make the conversion.  The gdistance package (also on R-forge) uses igraph to develop shortest paths across a grid, and illustrates the basic steps needed to make a structure of coordinates ready for analysis through igraph.

Jeremy Raw, P.E., AICP
FHWA Office of Planning
jeremy.raw at dot.gov
(202) 366-0986

-----Original Message-----
From: r-sig-geo-bounces at stat.math.ethz.ch [mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of Ricardo Rodríguez
Sent: Tuesday, August 24, 2010 5:22 PM
To: r-sig-geo at stat.math.ethz.ch
Subject: [R-sig-Geo] matrix distances

Hello everyone I am new to the use of R-cran, I have a question in which way can create arrays of distances (Euclidian and Into network) a network of roads with space objects.

thanks for your attention

Ricardo Rodríguez
Univalle

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list