Hi:
I am trying to synchronize the extents of a bunch of raster data sets
(originally .tif) I am working with but run into problems with the expand()
function. The function itself seems to work. str() and ncell() tell me that
everything is fine. But when I try to save or plot the result, I get error
message as depicted beneath. This happens to me for a number of different
data sets.
Have others used this function successfully? Or more to the point, have
others seen these error messages before and found a solution? A quick
Google search did not seem to indicate the latter.
Cheers,
     Jochen

> PopCount903=expand(PopCount90, e)

> plot(log(PopCount903))
Error in plot(log(PopCount903)) :
  error in evaluating the argument 'x' in selecting a method for function
'plot': Error in function (classes, fdef, mtable)  :
  unable to find an inherited method for function "writeStart", for
signature "RasterLayer", "missing"

> writeRaster(PopCount903, "PopCount903.tif")
Error in .local(.Object, ...) : Unable to create dataset

> ncell(PopCount903)
[1] 37324800

> str(PopCount903)
Formal class 'RasterLayer' [package "raster"] with 16 slots
  ..@ file      :Formal class '.RasterFile' [package "raster"] with 11 slots
  .. .. ..@ name        : chr
"C:\\Users\\Jochen\\AppData\\Local\\Temp\\R_raster_tmp\\Jochen\\raster_tmp_6826691987.grd"
  .. .. ..@ datanotation: chr "FLT4S"
  .. .. ..@ byteorder   : Named chr "little"
  .. .. .. ..- attr(*, "names")= chr "value"
  .. .. ..@ nodatavalue : num -3.4e+38
  .. .. ..@ nbands      : int 1
  .. .. ..@ bandorder   : Named chr "BIL"
  .. .. .. ..- attr(*, "names")= chr "value"
  .. .. ..@ offset      : int 0
  .. .. ..@ toptobottom : logi TRUE
  .. .. ..@ blockrows   : int 0
  .. .. ..@ blockcols   : int 0
  .. .. ..@ driver      : chr "raster"
  ..@ data      :Formal class '.SingleLayerData' [package "raster"] with 11
slots
  .. .. ..@ values    : logi(0)
  .. .. ..@ offset    : num 0
  .. .. ..@ gain      : num 1
  .. .. ..@ inmemory  : logi FALSE
  .. .. ..@ fromdisk  : logi TRUE
  .. .. ..@ isfactor  : logi FALSE
  .. .. ..@ attributes: list()
  .. .. ..@ haveminmax: logi TRUE
  .. .. ..@ min       : num 0
  .. .. ..@ max       : num 1167091
  .. .. ..@ band      : int 1
  ..@ legend    :Formal class '.RasterLegend' [package "raster"] with 5
slots
  .. .. ..@ type      : chr(0)
  .. .. ..@ values    : NULL
  .. .. ..@ color     : NULL
  .. .. ..@ names     : NULL
  .. .. ..@ colortable: NULL
  ..@ history   : list()
  ..@ title     : chr(0)
  ..@ extent    :Formal class 'Extent' [package "raster"] with 4 slots
  .. .. ..@ xmin: num -180
  .. .. ..@ xmax: num 180
  .. .. ..@ ymin: num -90
  .. .. ..@ ymax: num 90
  ..@ rotated   : logi FALSE
  ..@ rotation  :Formal class '.Rotation' [package "raster"] with 2 slots
  .. .. ..@ geotrans: num(0)
  .. .. ..@ transfun:function ()
  ..@ ncols     : int 8640
  ..@ nrows     : int 4320
  ..@ crs       :Formal class 'CRS' [package "sp"] with 1 slots
  .. .. ..@ projargs: chr " +proj=longlat +datum=WGS84 +no_defs
+ellps=WGS84 +towgs84=0,0,0"
  ..@ layernames: chr "PopCount90"
  ..@ z         : list()
  ..@ zname     : chr ""
  ..@ zvalue    : chr ""
  ..@ unit      : chr ""

	[[alternative HTML version deleted]]

