Learn R Programming

geostatsp (version 1.2.1)

nn32: Nearest neighbour matrices

Description

Some large nearest neighbour matrices.

Usage

data("nn32")

Arguments

format

Sparse matrices produced by NNmat, showing the neighbours of cells on a 64 by 64 grid in nn64, a 128 by 128 grid in nn128, and 256 in nn256.

Examples

Run this code
data("nn32")
dim(nn32)
dim(nn64)
dim(nn128)
x = 50
y=31
matrix(nn128[,128*(y-1)+x], 128, 128)[ x+seq(-4,4),y+seq(-4, 4)]

length(nn128@x)

nn32 = NNmat(32)
nn64 = NNmat(64)
nn128 = NNmat(128)
#save(nn32,nn64,nn128, file=
"/home/patrick/workspace/diseasemapping/pkg/geostatsp/data/nn32.RData",
compress='xz')

Run the code above in your browser using DataLab