Skip to content

exporting weiths matrix in .txt-file in spdep

2 messages · Mario Gellrich, Roger Bivand

#
Hi,

I have created a row-standardized spatial weigths matrix in spdep and 
wonder how it can be transformed to a simple .txt-file for export to other 
programs or simply visualisation of the weights matrix in form of rows and 
columns. Does anybody have a clue how to write out a weights matrix in spdep?

Best regards

Mario Gellrich
--------------------------------------------------
Mario Gellrich
Swiss Federal Research Institute WSL
Economics Section
Z?rcherstrasse 111
CH-8903 Birmensdorf
Tel:       ++41 (0)1 739 2520
Fax:       ++41 (0)1 739 22 15
e-mail:    mario.gellrich at wsl.ch
Web: http://www.wsl.ch/phonebook/STAFF/2409.ehtml
#
On Tue, 22 Mar 2005, Mario Gellrich wrote:

            
For example:
num [1:49, 1:49] 0 1 1 0 0 0 0 0 0 0 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:49] "1005" "1001" "1006" "1002" ...
  ..$ : NULL
 - attr(*, "call")= language nb2mat(neighbours = col.gal.nb, style = "B")
0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
....

For visualisation, this is nice, and scales to largish n:
Roger