[R-sig-Geo] Cost distance in spatial weight matrix

Facundo Muñoz f@cundo@munoz @ending from cir@d@fr
Mon Oct 29 14:48:43 CET 2018


Dear Roozbeh,

package geoRcb [1]* provides function distmatGen() [2], which computes a
cost-based distance matrix between any two sets of locations, given a
raster cost surface (such as elevation). The function uses package
gdistance to actually perform the computations, and it does not depend
on anything else in the package, so you can simply copy it to your code
base.

Is that what you were looking for?

ƒacu.-



[1] https://github.com/famuvie/geoRcb/

[2] https://github.com/famuvie/geoRcb/blob/master/R/distmatGen.R

* Disclaimer: I'm the author.


On 10/29/18 1:42 PM, Roozbeh Valavi wrote:
> Dear list,
>
> I wonder if it is possible to add some kind of cost/weighting when creating
> a spatial weight matrix to be used in a spatial lag model? I want to
> consider the effect of elevation as a cost for calculating distance to the
> neighbours.
> I am using spdep for creating the W and splm for the model.
>
> Thank you in advance,
> Roozbeh

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list