Hello all,
I am tempted to use spplot with a RasterStack, but for some reason, I
keep getting an error. Maybe someone out there has experienced the
same thing? See below.
st <- created from 9 IMG files
Error in nchar(filename) :
no slot of name "file" for this object of class "RasterStack"
In addition: Warning message:
In if (rotated | cells | (.driver(x, FALSE) != "gdal")) { :
the condition has length > 1 and only the first element will be used
However
spplot(as(st, 'SpatialGridDataFrame'))
is successful.
I am able to run the example in the spplot raster documentation with no errors.
r <- raster(system.file("external/test.grd", package="raster"))
s <- stack(r, r*2)
layerNames(s) <- c('meuse', 'meuse x 2')
spplot(s)
I am running on Windows Server 2008 R2, plus...
sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-pc-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets
methods base
other attached packages:
[1] rgdal_0.7-11 zoo_1.7-7 rasterVis_0.10-9
hexbin_1.26.0 latticeExtra_0.6-19
[6] RColorBrewer_1.0-5 lattice_0.20-6 raster_1.9-92
sp_0.9-99
loaded via a namespace (and not attached):
[1] tools_2.15.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Matthew Landis, Ph.D.
Research Scientist
ISciences, LLC
61 Main St., Suite 200
Burlington VT 05401
802-864-2999
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~