Error with command projectRaster()

I am regularly updating my R version and packages. Today I noticed, that a script does not work any more. I was re-projecting downloaded rainfall raster with a resolution of 0.1 degrees to UTM with a resolution of 500m. My raster objects are defined as follows:


>myr
class       : RasterLayer
dimensions  : 23, 31, 713  (nrow, ncol, ncell)
resolution  : 0.1, 0.1  (x, y)
extent      : 72.75, 75.85, 32.75, 35.05  (xmin, xmax, ymin, ymax)
coord. ref. : +init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
values      : in memory
min value   : 0
max value   : 89.96954 

> e
class       : RasterLayer
dimensions  : 480, 500, 240000  (nrow, ncol, ncell)
resolution  : 500, 500  (x, y)
extent      : 320000, 570000, 3660000, 3900000  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=43 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
values      : C:\AHT.PRO\Pakistan_Modelling\Data\Precipitation\NOAA\catchmnt0.tif
min value   : 1
max value   : 11

For the command (which executed before without problems)

myrm <- projectRaster(from=myr, to=e) 

I get now the following error message:

Error in extent(projectExtent(from, projto)) :
  error in evaluating the argument 'x' in selecting a method for function 'extent': Error in seq.default(min(ncol(object), 25), nrow(object), by = 50) :
  wrong sign in 'by' argument

The two rasters overlap only to about 90%. But when I change the commands as follows:

prj_utm <- "+init=epsg:32624" # UTM 43N, WGS84
myrm <- projectRaster(from=myr, crs=prj_utm, res=500)

I also receive an error message:

Error in seq.default(min(ncol(object), 25), nrow(object), by = 50) :
  wrong sign in 'by' argument

It looks like a bug to me (in packages sp, rgdal or raster).


	[[alternative HTML version deleted]]

