"spatial.neighbor"
spatial.neighbor.
spatial.sum(neighbor1, neighbor2, parameters1 = NULL,
parameters2 = NULL)
"spatial.neighbor" containing the sparse matrix
representation of the spatial neighbor matrix (or matrices, see function
spatial.neighbor).
"spatial.neighbor" containing the sparse matrix
representation of the spatial neighbor matrix (or matrices, see function
spatial.neighbor).
neighbor1.
If
parameters1 is not specified, a vector of ones is assumed.
neighbor2.
If
parameters2 is not specified, a vector of ones is assumed.
spatial.neighbor which equals the sum of the two
input objects of
spatial neighbor.
Argument
neighbor is a sparse matrix representation of one or more
matrices using to indicate the strength of "neighbor" relationships
for between regions on a spatial grid. Let
a[i,j] denote the
"(i,j)" element of the k-th such matrix. Then if
a[i,j] is not zero,
regions
i and
j are neighbors of the k-th kind, and the strength
of the relationship is given by the magnitude of
a[i,j].
spatial.weights
computes a weighted sum of the matrices
A, where
the weights in the linear combination are given by the elements in
argument
parameters.
row.id <- c(1,1,2,2,3) col.id <- c(2,3,1,3,4) neighbor1 <- spatial.neighbor(row.id=row.id, col.id=col.id) col.id <- c(1,2,3,4,1) neighbor2 <- spatial.neighbor(row.id=row.id, col.id=col.id) print(spatial.weights(neighbor1)) print(spatial.weights(neighbor2)) a <- spatial.sum(neighbor1,neighbor2) print(spatial.weights(a))