で geotiff を読み取れない理由はわかりませんが、とにかくraster
(パッケージ rgdal)SpatialGridDataFrame
によって提供される (パッケージ sp)readGDAL
を に直接渡すことができますraster()
。
rgdal パッケージの GeoTIFF の例を次に示します。rasterVis 関数は別のパッケージにあり、呼び出されることに注意してくださいplot3D
(rgl パッケージにある plot3d ではありません)。
library(rgdal)
library(rasterVis)
r <- raster(system.file("pictures/cea.tif", package = "rgdal")[1])
plot3D(r)

rasterVis パッケージは、すべてのスケーリングと色を処理し、優れたデフォルトを提供します。
サポート パッケージをさらに詳しく調べたい場合は、簡単な例を次に示します。
library(rgdal)
library(raster)
library(rgl)
## read the file with raster
r <- raster(system.file("external/test.ag", package="sp")[1])
## just use simple persp plot
persp(r)
## convert to sp's SpatialGridDataFrame (or use readGDAL directly)
## (for very large rasters this could be prohibitive in terms of memory)
sgdf <- as(r, "SpatialGridDataFrame")
## convert to R's image() format, a list with x,y vector and z matrix
x <- as.image.SpatialGridDataFrame(sgdf)
## plot with rgl, ugly but see ?surface3d for colour options etc.
surface3d(x$x, x$y, x$z)
