将rasterbrick从内存保存到磁盘

时间:2016-09-24 07:17:11

标签: r modeling

我有一个使用dismo R包生成的栅格砖:

  

生物型(PREC,Tmax时,TMIN)   class:RasterBrick   尺寸:621,1405,872505,19(nrow,ncol,ncell,nlayers)   分辨率:0.04166667,0.04166667(x,y)   范围:-125.0208,-66.47917,24.0625,49.9375(xmin,xmax,ymin,ymax)   坐标。 REF。 :NA   数据源:在内存中   名称:bio1,bio2,bio3,bio4,bio5,bio6,bio7,bio8,bio9,bio10,bio11,bio12,bio13,bio14,bio15,...   最小值:-5.877542,-22.975250, - ?,128.791868,-4.569000,-13.221000,-6.819000,-11.703167,-15.058666,1.778000,-15.058666,31.000000,6.000000,0.000000,4.860504,...   最大值:2.546279e + 01,-2.974167e + 00,1.828863e + 06,1.357540e + 03,3.081900e + 01,2.528200e + 01,2.591300e + 01,3.418683e + 01,3.568500e + 01,3.696917 e + 01,2.146250e + 01,6.317000e + 03,1.146000e + 03,1.440000e + 02,1.295139e + 02,......

我想将rasterbrick中包含的19个图层保存为单独的.asc文件。

我试过了 writeRaster(brick,filename =“bio.asc”,format =“ascii”,bylayer = TRUE),但最终出现以下错误:

Error in (function (classes, fdef, mtable)  :   unable to find an inherited method for function ‘writeRaster’ for signature ‘"standardGeneric", "character"’

1 个答案:

答案 0 :(得分:0)

我可能错了,但是从错误信息来看,在我看来你将错误的变量传递给了写入器(即,不是光栅,rasterstack或rasterbrick)