OK, spending an afternoon working through the examples in sp.pdf is a
valuable exercise :-)

This seems to do what I need:

library(rgdal)

## default memory limit insufficient
memory.limit(1536) ## 1.5e9 * 1024 Mb

pts = expand.grid(long = d$x, lat = d$y)
grd.atts = data.frame(pts, depth = as.vector(d$z))
rm(d, pts)
coordinates(grd.atts)  = ~ long + lat
gridded(grd.atts) <- TRUE
fullgrid(grd.atts) <- TRUE

image(as.image.SpatialGridDataFrame(grd.atts),
      col= terrain.colors(256), main = "Reference Image")

writeGDAL(grd.atts["depth"], "surface.tif", mvFlag = -32768)


Thanks to the sp implementors!

	[[alternative HTML version deleted]]


