Forum: help


Request concerning read.gwt2dist [ Reply ] By: Bernd Jost on 2012-03-11 08:12 | [forum:5579] |
Dear Developers, I want to convert a distance matrix (D) to an object of class "distance.matrix" by using the "read.gwt2dist" command in order to carry out S2SLS procedures provided in the sphet package. D is accessible as a dataframe and contains three columns ("from","to","distance"). D was already used to construct weighting matrices of class "listw" "nb". Since the sphet manual states that "read.gwt2dist" could also read other extensions, I first created a txt file of D and tried to apply "read.gwt2dist" but encountered problems reading in the data. I am wondering if there is an easy way to convert a dataframe or neighbours and weights list objects respectively to a "distance.matrix" object. Using the "distance" command is principally an option, however not first best, since my data already captures the distance relations of the spatial points adequately, taking into account the structure of the underlying road network connecting all points in the sample. I would be thankful for any piece of advise. Best regards, Bernd Jost |