Description Usage Arguments Details Value Note
Evaluates a raster or raster using logical tests
1 2 |
x |
Any raster calculation statement |
tmpdir |
Location raster will be written to if too big to handle in memory |
format |
Default format for rasters, here geotiff |
NAval |
Value to set to NA, default is NULL |
filename |
Output raster name, with gdal compliant extension |
The file writing part is a bit complicated. The name you provide the function will force a write to disk only if the calculation can be done in memory. Otherwise, if raster wrote a temporary file to disk because it was too big for memory, the function returns that object. This is why the function gives control as to where you can write a filename.
Raster* resulting from raster algebra statement
This function was modified from one found in my old ldefuncs.rs.R. As noted there, this should be improved to run in blocks, and perhaps parallelize, while calculation is being done. In future this function, if it proves useful, should go into separate R library for raster functions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.