Options are stored in a persistent file in AppData, see pgconfig_cache$info()
An object of class PGOptionsManager (inherits from R6) of length 25.
Methods
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_automatic_download()
Set to true if data downloads should be done automatically.
Usage
PGOptionsManager$set_automatic_download(value)
Arguments
value
Boolean If TRUE, PRIOGRID will attempt to download files that are needed when trying to read specific sources.
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(unparsed = FALSE)
Arguments
unparsed
Boolean, if TRUE, then return the user input string, else parse with terra::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_automatic_download()
Get download prompt option
Usage
PGOptionsManager$get_automatic_download()
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: 18
#> ncol: 36
#> crs: +proj=laea +lon_0=106.875 +lat_0=58.5295629 +datum=WGS84 +units=m +no_defs
#> extent: 0 180 0 90
#> rawfolder: /Volumes/T7/priogrid_data
#> verbose: FALSE
#> automatic download: TRUE
#> temporal resolution: 1 quarter
#> start date: 2022-12-31
#> end date: 2025-08-26