PGOptionsManager: R6 Class to set and get package-wide options for PRIO-GRID.

PGOptionsManagerR Documentation

R6 Class to set and get package-wide options for PRIO-GRID.

Description

Options are stored in a persistent file in AppData, see pgconfig_cache$info()

Usage

pgoptions

Format

An object of class PGOptionsManager (inherits from R6) of length 23.

Methods

Public methods


Method new()

Initialize options

Usage
PGOptionsManager$new()

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)
Arguments
value

CRS string


Method set_nrow()

Set number of rows in output raster

Usage
PGOptionsManager$set_nrow(value)
Arguments
value

Integer


Method set_ncol()

Set number of cols in output raster

Usage
PGOptionsManager$set_ncol(value)
Arguments
value

Integer


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)
Arguments
value

Boolean


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)
Arguments
value

a date or "today"


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 print()

Prints all options

Usage
PGOptionsManager$print()

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()
pgoptions$set_rawfolder <- tempfolder()
pgoptions$set_verbose(FALSE)
pgoptions$print()

prio-data/priogrid documentation built on June 14, 2025, 11:06 p.m.