s-news
[Top] [All Lists]

Re: [S] neighbor.grid question

To: c7lri@ttacs.ttu.edu
Subject: Re: [S] neighbor.grid question
From: <msvika@mscc.huji.ac.il>
Date: Thu, 24 Feb 2000 22:22:17 +0200 (WET)
Cc: s-news@wubios.wustl.edu
In-reply-to: <Pine.PMDF.3.96.1000224141126.543518611A-100000@TTACS.TTU.EDU>
Sender: owner-s-news@wubios.wustl.edu
Irene,I've really forgotten that I have 
an example of my old function for finding spatial neighbors.
The following function will find the neighbors on lattice by the first
order method with max.dist=5.
Hope this helps.
Viki.

neighbor.fun_function(x,y)
{
#function to define neighbor connections
 
my.weight.fun_function(row1,col1,row2,col2)
{
if (row1==row2) 
   if (abs(col1-col2)<=5)
return(1)
else return(0)
else if (col1==col2)
    if (abs(row1-row2)<=5)
    return(1)
    else return(0)
else return(0)
}

module(spatial)
ng5_neighbor.grid(nrow=x, ncol=y, neighbor.type="user",
weight.fun=my.weight.fun, max.horiz.dist=6, max.vert.dist=6,
use.pattern=T)
ng5_spatial.condense(ng5, symmetry=T)
s_ng5$row.id
t_ng5$col.id
return(s,t)
}

st_neighbor.fun(24,24)
s_st$s
t_st$t


On Thu, 24 Feb 2000 c7lri@TTACS.TTU.EDU wrote:

> Hi Viki,
> Thanks for answering my message.  Yes I have an spatial module, and I'm in
> the process of learning how to use it.  I am not sure that I am entering
> my data in the correct way, but I'll keep trying.
> 
> Thanks.
> 
> Raquel Irene
> 
> 

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>