[R-sig-Geo] From Sparse Matrix to Listw (capacity problems)

Martin Reismann mreisman at isis.wu-wien.ac.at
Tue Oct 24 20:25:10 CEST 2006

Dear colleagues,

This message concerns packages spdep and SparseM.

I have a problem converting a large binary weight matrix (12432 *
12432) from matrix.csr class to listw. 

I tried W.listw <- asListwMatrixCsr(W.csr)
which gives: error in asListwMatrixCsr(W.csr): row indices out of range

As a second approach I tried to read elements of the Sparse matrix one
by one to write an ASCII (GAL) file from W.csr. This failed as well 
because my method of accessing matrix
is much too slow.

I am grateful for either:
- hints how to increase capacity of asListwMatrixCsr
- hints whether there is a Sparse matrix class and/or single element
access method which is faster.
- (or other workarounds).

Best wishes,
Martin Reismann

Mag. Martin Reismann
Institut fuer Wirtschaftsgeographie und Geoinformatik
Wirtschaftsuniversitaet Wien
Nordbergstrasse 15, 4. Stock, Kern A
A-1090 Wien

EMail: Martin.Reismann at wu-wien.ac.at
Tel +43-(0)-1-31336-5720
Fax +43-(0)-1-31336-703

More information about the R-sig-Geo mailing list