[R] regularly lattice & neighbors

Alvaro A. Novo novo at uiuc.edu
Thu Mar 30 01:12:06 CEST 2000

Dear R-users,

Is there a procedure to identify neighbors in a regular lattice using either a
"rook" or a "queen" criterium? To be more specific, suppose:

My lattice:

1	2	3
4	5	6
7	8	9

"Rook" Neighbors

1 has neighbors 2,4
2 has neighbors 1,3,5
5 has neighbors 2,4,6,8

"Queen Neighbors"

1 has neighbors 2,4,5
2 has neighbors 1,3,4,5,6

For each case, the final output would be a 9x9 matrix with 0's and 1's.

I have access to a software that does this for me, but it would be nice to
avoid importing such matrices.

Thank you for your help,

Alvaro Novo
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list