raster (version 1.0.4)

Options: Global options for the raster package

Description

setOptions allows you to set, and inspect, a number of global options used by the raster package. Most of these options, are used when writing files to disk. They can be ignored by specific functions if the corresponding argument is provided as an argument to these functions. The default location is returned by rasterTmpDir. It is the same as that of the R tempdir but you can change it (for the current session) with rasterOptions(tmpdir=. To permanentely set any of these options, you can add them to /etc/Rprofile.site. For example, to change the default directory used to save temporary files, add a line like this: options(rasterTmpDir='c:/temp/') to that file. Beware: all raster (*.grd and *.gri) files in that folder will be deleted every time the raster package is loaded. showOptions shows the current options saveOptions attempts to save the current options (with the exception of the 'todisk' option) to the /etc/Rprofile.site file to make them persistent (they will be set when starting a new R session). clearOptions resets the options to their default values.

Usage

setOptions(format, overwrite, datatype, tmpdir, progress, chunksize, todisk)
showOptions()
saveOptions()
clearOptions()

Arguments

format
Character. The default file format to use. See writeFormats
overwrite
Logical. The default value for overwriting existing files. If TRUE, existing files will be overwritten
datatype
Character. The default data type to use. See dataType
tmpdir
Character. The default location for writing temporary files
progress
Character. Valid values are "text", "tcltk" (requirs the tcltk package), "windows" (on that platform only) and "" (the default in most functions, no progress bar)
chunksize
Integer. Maximum number of cells to read/write in a single chunk while processing (chunk by chunk) disk based Raster* objects
todisk
Logical. For debugging only. Default is FALSE and should normally not be changed. If TRUE, results are always written to disk, even if no filename is supplied (a temporary filename is used)

Value

  • this function is used for the side-effect of setting global options

Details

argument format sets global option rasterFiletype. The option is ignored by a function if you pass format as an argument to that function. argument overwrite sets global option rasterOverwrite. The option is ignored by a function if you pass overwrite as an argument to that function. argument datatype sets global option rasterDatatype. The option is ignored by a function if you pass datatype as an argument to that function. argument tmpdir sets global option rasterTmpDir. See rasterTmpFile argument progress sets global option rasterProgress. The option is ignored by a function if you pass progress as an argument to that function.

See Also

options, rasterTmpFile