if (FALSE) {
shorePossums <- predictDsurface(possum.model.Ds)
tmp <- raster(shorePossums, covariate = "D.0")
library(raster)
plot(tmp, useRaster = FALSE)
## alternative with same result
tmp <- raster(shorePossums, values = covariates(shorePossums)$D.0)
## set the projection
## here the crs PROJ.4 spec refers simply to the old NZ metric grid
tmp <- raster(shorePossums, "D.0", crs = "+proj=nzmg")
## check the projection
proj4string(tmp)
# mask to rast
dtsrast <- rast(possummask, covariate = 'd.to.shore')
plot(dtsrast)
# Dsurface to rast
class(shorePossums) <- c('mask', 'data.frame') # or change "mask" to "Dsurface" above
Drast <- rast(shorePossums, covariate = 'D.0')
plot(Drast)
}
Run the code above in your browser using DataLab