[R-sig-Geo] writeRaster and raster give same error after package update

Guillaume Drolet droletguillaume at gmail.com
Tue Nov 19 21:35:30 CET 2013


Hi,

I've been working on a set of functions for a bit more than a month.
This morning I updated all my packages (but not R) and now, when I
call:

outfile <- "b4.sinks.sgrd"
writeRaster(myraster, outfile, overwrite = TRUE, datatype = "FLT4S",
    NAflag = -9999)

or

infile <- "b4.sinks.sdat"
r <- raster(infile)

from within one of my functions, I get this error:

Error in if (is.null(projs) | is.na(projs) | nchar(projs) < 3) { :
  argument is of length zero
In addition: Warning message:
In is.na(projs) : is.na() applied to non-(list or vector) of type 'NULL'

My function that calls writeRaster() and raster() hasn't changed in a
while. It was working fine just yesterday! From the error message, it
looks like .makeProj (in makeProjString.R) calls .newCRS with an
unknown projection, although I never changed my raster's projections
since I started working on this project. Here's the output of
proj4string(myraster):

 "+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"

Here's the output of sessionInfo():

R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

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

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

other attached packages:
 [1] snow_0.3-13       raster_2.1-66     devtools_1.3
stringr_0.6.2     RSAGA_0.93-6      plyr_1.8
 [7] shapefiles_0.7    foreign_0.8-55    gstat_1.0-17
rgdal_0.8-11      data.table_1.8.10 sp_1.0-14

loaded via a namespace (and not attached):
 [1] digest_0.6.3     evaluate_0.5.1   grid_3.0.2       httr_0.2
  intervals_0.14.0 lattice_0.20-23
 [7] memoise_0.1      parallel_3.0.2   RCurl_1.95-4.1
spacetime_1.0-9  tools_3.0.2      whisker_0.3-2
[13] xts_0.9-7        zoo_1.7-10

I'm getting frustrated as I'm about to finish this program I've been
working on for a while and now I'm stuck!!

Thanks for your help,

Guillaume



More information about the R-sig-Geo mailing list