So now when I use it as a mask:
trajmap$v<-ifelse(trajmap$v>50, 0, 1)
library(maptools)
...and convert it to a RasterLayer for matrix algebra with another raster
trajrast<-raster(as.SpatialGridDataFrame.im(from=trajmap))
tempmap<-crop(habmap, extent(trajrast)) # tempmap.grd is attached
top<-table(getValues(tempmap*trajrast))
Error in compare(c(e1, e2)) : Different bounding box
Error in getValues(tempmap * trajrast) :
error in evaluating the argument 'x' in selecting a method for function
'getValues'
...it doesn't work because the resolution is not exactly equal. Now I can
sometimes trick it when the number of rows and cells are still equal, BUT...
extent(trajrast)<-extent(tempmap)
top<-table(getValues(tempmap*trajrast))
Error in compare(c(e1, e2)) : nrows different
Error in getValues(tempmap * trajrast) :
error in evaluating the argument 'x' in selecting a method for function
'getValues'
...This is not always the case!
How can I prevent the numbers of rows and columns from being so slightly
different because of a minor different in resolution? Otherwise put, how
can I make the actual resolution of my distmap image exactly 25m as desired?
Tyler