Re: [R] Spatial: number of independent components?

From: nikhil kaza <nikhil.list_at_gmail.com>
Date: Mon, 21 Jun 2010 00:21:49 -0400

Instead of nb2mat try

as.spam.listw(nb2listw(cell2nb(...)))

this will coerce the adjacency matrix into a sparse matrix representation saving lot of memory.

Nikhil

On Sun, Jun 20, 2010 at 10:27 PM, Daniel Malter <daniel_at_umd.edu> wrote:

>
> Hi, thanks much. This works in principle. The corrected code is below:
>
> a <- nb2mat(cell2nb(nrow(x),ncol(x),torus=T), style="B")
> g <- delete.vertices(graph.adjacency(a), which(x!=1)-1)
>
> plot(g)
> clusters(g)
>
> the $no argument of the clusters(g) function is the sought after number.
> However, the function is very slow, and my machine runs out of memory (1G)
> for a 101 by 101 matrix.
>
> Daniel
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Spatial-number-of-independent-components-tp2262018p2262090.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 21 Jun 2010 - 04:24:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Jun 2010 - 10:40:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive