raster (version 1.0.4)

saveAs: Save a Raster* object to a new file

Description

Save a RasterLayer or RasterBrick to a new file; for example a file of another format (format). You can also use this function to save a RasterStack to a single (muti-band) file.

Usage

saveAs(x, filename, ...)

Arguments

x
RasterLayer or RasterBrick object
filename
Character. Output filename
...
additional arguments. See Details.

Value

  • A RasterLayer or RasterBrick object. This primary use of this function is its side-effect of writing a file to disk.

Details

The following additional arguments can be passed, to replace default values for this function rll{ format Character. Output file type. See writeRaster datatype Character. Output data type. See dataType overwrite Logical. If TRUE, "filename" will be overwritten if it exists progress Character. Valid values are "text", "tcltk", "windows" (on that platform only) and "" }

See Also

writeFormats, writeRaster

Examples

Run this code
r1 <- raster(system.file("external/test.grd", package="raster"))
r2 <- saveAs(r1, 'testnew.grd', format='raster')

Run the code above in your browser using DataLab