[R-sig-Geo] Error in writeRaster?
Diann Prosser
dprosser at usgs.gov
Fri Mar 16 20:02:27 CET 2012
Hi all,
I'm running the latest version of R (info below) with the raster and rgdal
libraries loaded.
I get the following error when trying to write to a raster (one I have not
seen before with previous runs of this code):
> rRisk_mn <- writeRaster(risk_mn, 'risk_mn.tif', format=raster,
> overwrite=TRUE) # for ArcGIS
*Error in function (classes, fdef, mtable) :
unable to find an inherited method for function "writeRaster", for
signature "matrix", "character"*
More code is supplied below in case it's helpful. Thanks for any help in
fixing this error.
Kind regards,
Diann
________________________________________________________________
bits from sessionInfo():
R version 2.14.2 (2012-02-29)
Platform: x86_64-pc-mingw32/x64 (64-bit)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rgdal_0.7-8 raster_1.9-70 sp_0.9-97 mc2d_0.1-12
[5] mvtnorm_0.9-9992
loaded via a namespace (and not attached):
[1] grid_2.14.2 lattice_0.20-0 tools_2.14.2
_________________________________________________________________
#building final array (4 simulations on 4848x4053 cells)
risk <- array(risk, dim=c(ny,nx,nsimu))
#mean for each location
risk_mn<- apply(risk,c(1,2),mean)
setwd("C:/Trisk/Output")
rRisk_mn <- writeRaster(risk_mn, 'risk_mn.tif'see, format=raster,
overwrite=TRUE) # for ArcGIS
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Error-in-writeRaster-tp7379982p7379982.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list