[R-sig-dyn-mod] simecol: neighbours

"Pablo García Díaz" garciap at usal.es
Thu Sep 13 19:40:51 CEST 2012


Dear people in the forum,

I'm begining to use simecol for modeling the spatial spread of some
animals. First of all, I've a dispersal kernel to measure the distances of
dispersal by animals.
Then, I've a matrix in the same discrete scale as the dispersal kernels
(this helps in the routines of calculations). However, I need to calculate
not only the eight direct neighbours of each cell, but also other indirect
neighbours and all of them independently (as one probability value applies
to each one).

For example, I need to know the number of occupied cells that are 2 cells
away from the cell of interest and the number of occupied cells that are 3
cells away from the cell of interest.

One can do this work using the neighbour function, but here comes the
question, should I specify the weighted neighbour matrix for each position
in the original matrix? This is, should I build a neigbour matrix for each
of the positions in the original one? The code for this idea will be:

#### ORIGINAL DISTRIBUTION

original(t0)<-matrix(c(0,0,0,0,
0,0,0,0,
0,0,1,0,
0,0,0,0), nrow=4, ncol=4)

#### NEIGHBOURS OF [1,1] WITHIN 3 CELLS IN t0

wdist_3<-matrix(C(0,0,0,0,
0,0,0,0,
0,0,1,0,
0,0,0,0), nrow=4, ncol=4)

#### NEIGHBOURS OF [1,1] WITHIN 2 CELLS in t0

wdist_3<-matrix(C(0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0), nrow=4, ncol=4)

and then repeat the process for each [i, i] position? Or there is a
easiest way?

Thanks in advance for your help, best regards,

Pablo


-- 
Pablo Garcí­a Dí­az
Departamento de Biología Animal
Universidad de Salamanca
Campus Miguel de Unamuno
37007 Salamanca (Spain)
e-mail: garciap at usal.es

Department of Animal Biology
University of Salamanca
Campus Miguel de Unamuno
37007 Salamanca (Spain)
e-mail: garciap at usal.es



More information about the R-sig-dynamic-models mailing list