Write a SpatRaster to a file.
# S4 method for SpatRaster,character
writeRaster(x, filename, overwrite=FALSE, wopt=list(), ...)SpatRaster
character. Output filename. Optional
logical. If TRUE, filename is overwritten
list. Options for writing files. See Details
Additional arguments. None implemented
SpatRaster (invisibly). This function is used for the side-effect of writing values to a file.
In many methods, options for writing raster files to disk can be provided with the wopt argument. wopt should be a named list. The following names are valid: filetype and datatype.
Values for filetype are GDAL driver names. If this argument is not supplied, the driver is derived from the filename.
Values for datatype are "INT2U", "INT2S", "INT4U", "INT4S", "FLT4S", "FLT8S". The first three letters indicate whether it is an integer (whole numbers) of float (decimal numbers), the fourth character indicates the number of bytes used (allowing for large numbers, and/or more precision), and the "S" or "U" indicate whether the values are signed (both negative and positive) or unsigned (postive values only).