[R-sig-Geo] Inner edge() sometimes outside using raster package

pgalpern pgalpern at gmail.com
Mon Nov 7 18:35:51 CET 2011


Hello!

Perhaps I am doing something wrong, here, but in the following case the 
edge() function in the raster package appears to find an edge that is 
two cells wide when I don't think it should.

There are three objects on the raster, each is a 9 cell square.  One of 
these squares is one cell away from the border of the raster.  It is on 
this square that the error occurs.

library(raster)
download.file("http://nricaribou.cc.umanitoba.ca/R/edgeissue.asc", 
"~/edgeissue.asc")
edgeIssue <- raster("~/edgeissue.asc")
findEdge <- edge(edgeIssue, type="inner")
plot(findEdge)

which((findEdge==1 & is.na(edgeIssue))[])
## Gives cell numbers: 12037 12038 12039
## These are outside any of the squares on the raster edgeIssue

Any thoughts would be appreciated.

Thanks,
Paul

-- 
Paul Galpern, PhD Candidate
Natural Resources Institute
70 Dysart Road
University of Manitoba
Winnipeg, Manitoba, Canada R3T 2M6
http://borealscape.ca



More information about the R-sig-Geo mailing list