[R-sig-Geo] Fwd: Re: Problem creating raster brick (Lyndon Estes)

Lyndon Estes lyndon.estes at gmail.com
Mon Nov 21 17:40:54 CET 2011

Hi Swen,

Thanks for the suggestion. That brings to mind an earlier problem I
had with a different functions substituting values on large rasters,
and I got around it by writing the following lines into the code:

  if(raster:::.toDisk() != TRUE) {
     setOptions(todisk = TRUE)
     cat("We don't want memory problems--forcing write to disk.\n")

So I will see if that works in this case.  However, I am still curious
why the problem is occurring with my particular grid files, but not
with the dummy rasters I made, which are in fact somewhat larger.
Also, the combined size of the 9 grids is < 30 mb, which was well
below my available memory (~about 500 mb free).

In the meantime, I am continuing with stacks and checking whether a
forced write or lower memory limits will help.

Thanks again,


On Mon, Nov 21, 2011 at 6:24 AM, Swen Meyer <s.meyer at lmu.de> wrote:
> Dear Lydon,
> I also had some trouble with stacking Layers in the  Raster package. Try to
> use a 32 bit version of R. Sounds weired but in my case the stacking with
> the Raster package was much faster using the Raster Package on a 32 bit - R
> Version. This is what Robert Hijmans once wrote me when I had some trouble
> with the Raster Stacking:
> "
> Thanks that is very good to know. raster checks if the data can all be
> processed in memory, and if so, does that (up to a point), for better speed.
> There is a limit set by maxmemory. See
> showOptions()
> Perhaps setting maxmemory to a lower value
> e.g.,
> setOptions(maxmemory=1e+08)"
> Hope this will help you.
> Greetings,
> Swen
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

More information about the R-sig-Geo mailing list