[R-sig-Geo] NAs returned as from and to IDs in gabrielneigh function in the spdep package

Dan Putler dan.putler at sauder.ubc.ca
Wed Jan 21 00:54:11 CET 2009


Hi,

The issue is as in the subject. I'm running R 2.8.1 with spdep 0.4-29,
tripack 1.2-11, sp 0.9-14, maptools 0.6-13, spam 0.15-2, and Matrix
0.999375-17 under Linux (I'm still on Ubuntu Dapper). In addition to
gabrielneigh returning NAs for "from" and "to" point IDs, when the
resulting graph object is given to graph2nb, R senses a segmentation
fault and experiences a hard crash. The short (self-contained) script
below generates the error on my system.

dx <- rep(0.25*0:4,5)
dy <- c(rep(0,5),rep(0.25,5),rep(0.5,5), rep(0.75,5),rep(1,5))
exampDat <- data.frame(x=c(dx, dx, 3+dx, 3+dx), y=c(dy, 3+dy, dy, 3+dy))
plot(exampDat)
library(spdep)
exampGG <- gabrielneigh(as.matrix(exampDat))
print(data.frame(from=exampGG$from, to=exampGG$to))
# Uncomment the line below to induce a segmentation fault R crash
# exampNB <- graph2nb(exampGG)
rm(list=c("bx","by","exampDat","exampGG","exampNB"))

Dan

-- 
Dan Putler
Sauder School of Business
University of British Columbia




More information about the R-sig-Geo mailing list