[R-sig-Geo] Bug in raster::canProcessInMemory?

Kenny Bell kmb56 at berkeley.edu
Sun Mar 5 01:27:09 CET 2017


The current code is:

```
function(x, n=4) {

if (.toDisk()) {
return(FALSE)
}
n <- n + nlayers(x) - 1
cells <- round( 1.1 * ncell(x) ) * n

if ( cells > .maxmemory() ) {
return(FALSE)
} else {
return(TRUE)
}
}
```
The line ``n <- n + nlayers(x) - 1`` seems like it should be ``n <- n *
nlayers(x)``.

Better yet, I'd remove that line and change the next to: ``cells <- round(
1.1 * ncell(x) * nlayers(x) ) * n``

Hope this helps,
Kenny

-- 
Kendon Bell
Email: kmb56 at berkeley.edu
Phone: (510) 612-3375

Ph.D. Candidate
Department of Agricultural & Resource Economics
University of California, Berkeley

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list