[R-sig-Geo] Warning message: points were rejected as lying outside the specified window
Hossain, Md
Md.Hossain at cchmc.org
Thu May 15 16:05:53 CEST 2014
Hi,
Apology, my problem may be so simple to answer. I am trying to read disease locations (in longitude and latitude) for 49 adjacent states of USA as an PPP object with the R code:
usdat <- data.frame(x=data$X, y=data2$Y)
usmap <- map('usa', fill=TRUE, col="transparent", plot=FALSE)
uspoly <- map2SpatialPolygons(usmap, IDs=usmap$names, proj4string=CRS("+proj=longlat +datum=WGS84"))
spatstat.options(checkpolygons=FALSE)
usowin <- as.owin.SpatialPolygons(uspoly)
spatstat.options(checkpolygons=TRUE)
pts <- as.ppp(usdat, W=usowin)
plot(pts)
But, getting the warning messages:
1: point-in-polygon test had difficulty with 2 points (total score not 0 or 1)
2: In ppp(X[, 1], X[, 2], window = win, marks = marx, check = check) :
42 points were rejected as lying outside the specified window
Please suggest if there is any way I can keep these 42 points. With regards,
Monir
More information about the R-sig-Geo
mailing list