[R-sig-Geo] Error with recent versions of raster: no slot named "rotated" for this object of class "RasterStack"

Boris Leroy leroy.boris at gmail.com
Tue May 24 14:09:39 CEST 2011


Dear list,

I updated today my raster package and I am getting error messages with
functions that were previously working.

For example, in order to select layers in stacks, I was previously
using double brackets, but it doesn't work anymore:

> testStack
class       : RasterStack
dimensions  : 3600, 9480, 4  (nrow, ncol, nlayers)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : -14, 65, 30, 60  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
min values  : 0 0 0 0
max values  : 1 1 1 1

> testStack[[1]]
Erreur dans .local(x, ...) :
  aucun slot de nom "rotated" pour cet objet de la classe "RasterLayer"

Which roughly translates into "no slot named "rotated" for this object
of class "RasterStack""

I can still use the subset function:

> subset(testStack, 1)
class       : RasterLayer
dimensions  : 3600, 9480, 34128000  (nrow, ncol, ncell)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : -14, 65, 30, 60  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
values      : in memory
min value   : 0
max value   : 1

However, I have the same error with writeRaster and I was not able to
find a workaround:

> writeRaster(testStack, "./tempStack.grd", overwrite=T)
Erreur dans .local(x, ...) :
  aucun slot de nom "rotated" pour cet objet de la classe "RasterStack"


I suppose this error relates to recent updates for rotated rasters.
Am I doing something wrong or is there an unexpected bug somewhere?

Thanks,

Boris

----
> sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252
LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                   LC_TIME=French_France.1252

attached base packages:
[1] grid      splines   stats     graphics  grDevices utils
datasets  methods   base

other attached packages:
 [1] ggplot2_0.8.9      proto_0.3-9.2      reshape_0.8.4
plyr_1.5.2         rgdal_0.6-33       raster_1.8-22
 [7] sp_0.9-81          BIOMOD_1.1-6.9     foreign_0.8-43
gam_1.04.1         randomForest_4.6-2 mda_0.4-2
[13] class_7.3-3        gbm_1.6-3.1        lattice_0.19-23
MASS_7.3-12        Design_2.3-0       Hmisc_3.8-3
[19] survival_2.36-5    rpart_3.1-49       nnet_7.3-1         ade4_1.4-17

loaded via a namespace (and not attached):
[1] cluster_1.13.3 digest_0.4.2   tools_2.13.0

-- 
Boris Leroy,
PhD Student,
Equipe Biodiversité et Gestion des Territoires,
Muséum National d'Histoire Naturelle, UMR 7204
Université de Rennes 1
Campus de Beaulieu, Bât. 25, 1er étage
35042 Rennes cedex

+33 (0) 2 23 23 58 99



More information about the R-sig-Geo mailing list