Options are stored in a persistent file in AppData, see pgconfig_cache$info()
An object of class PGOptionsManager
(inherits from R6
) of length 23.
Methods
Method new()
Initialize options
Method reset_options()
Reset options to defaults.
Usage
PGOptionsManager$reset_options()
Method set_extent()
Set output spatial extent
Usage
PGOptionsManager$set_extent(value)
Arguments
value
A vector with extent, c(xmin, xmax, ymin, ymax)
Method set_crs()
Set output CRS
Usage
PGOptionsManager$set_crs(value)
Method set_nrow()
Set number of rows in output raster
Usage
PGOptionsManager$set_nrow(value)
Method set_ncol()
Set number of cols in output raster
Usage
PGOptionsManager$set_ncol(value)
Method set_rawfolder()
Set the folder where raw-data should be downloaded (possibly very large files), defaults to temporary folder
Usage
PGOptionsManager$set_rawfolder(value)
Arguments
value
String path to folder
Method set_verbose()
Set verbose output of functions if true.
Usage
PGOptionsManager$set_verbose(value)
Method set_temporal_resolution()
Set temporal resolution
Usage
PGOptionsManager$set_temporal_resolution(value)
Arguments
value
String increment of temporal sequence. See base::seq.Date for more information.
Method set_start_date()
Set start date
Usage
PGOptionsManager$set_start_date(value)
Arguments
value
The date used globally to build PRIO-GRID. The month and day are used to define the
measurement date within the temporal resolution (e.g., as.Date(1900-06-30) would slice June 30 every year for compatible data sources).
Method set_end_date()
Set end date
Usage
PGOptionsManager$set_end_date(value)
Method get_crs()
Get crs option
Usage
PGOptionsManager$get_crs()
Method get_extent()
Get extent option
Usage
PGOptionsManager$get_extent()
Method get_nrow()
Get nrow option
Usage
PGOptionsManager$get_nrow()
Method get_ncol()
Get ncol option
Usage
PGOptionsManager$get_ncol()
Method get_rawfolder()
Get rawfolder option
Usage
PGOptionsManager$get_rawfolder()
Method get_verbose()
Get verbose option
Usage
PGOptionsManager$get_verbose()
Method get_temporal_resolution()
Get temporal resolution option
Usage
PGOptionsManager$get_temporal_resolution()
Method get_start_date()
Get start date option
Usage
PGOptionsManager$get_start_date()
Method get_end_date()
Get end date option
Usage
PGOptionsManager$get_end_date()
Method clone()
The objects of this class are cloneable with this method.
Usage
PGOptionsManager$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
pgoptions <- PGOptionsManager$new()
#> Error: object 'PGOptionsManager' not found
pgoptions$set_rawfolder <- tempfolder()
#> Error in tempfolder(): could not find function "tempfolder"
pgoptions$set_verbose(FALSE)
pgoptions$print()
#> Current options:
#> nrow: 360
#> ncol: 720
#> crs: epsg:4326
#> extent: -180 180 -90 90
#> rawfolder: /Volumes/T7/priogrid_data
#> verbose: FALSE
#> temporal resolution: 1 year
#> start date: 1850-12-31
#> end date: 2025-08-26