Skip to contents

In PRIO-GRID, all functions that are named "gen_something()" are functions that return final variables as a SpatRaster (or a stack of these). This function calculates all variables and store them in "path/to/your/rawfolder/priogrid/version/options_hash/variable_name.rds".

Usage

calculate_pgvariables(gen_functions = NULL, overwrite = FALSE)

Arguments

gen_functions

Character vector with priogrid functions starting with gen_. If NULL, then all are used.

overwrite

Boolean, if false, will ignore updating variables that already exist in the result folder

Examples

calculate_pgvariables()
#> Warning: cannot create dir '/Volumes/T7', reason 'Permission denied'
#> Error in get_pgfile(source_name = "CRU Climate", source_version = "v4.09",     id = "9bba83b0-eca9-4f05-b1df-6aeaed55a9fa"): /Volumes/T7/priogrid_data does not exist. Please pgoptions$set_rawfolder().
r <- readRDS(file.path(pgoptions$get_rawfolder(), "priogrid", packageVersion("priogrid"), "naturalearth_cover.rds"))
#> Warning: cannot open compressed file '/Volumes/T7/priogrid_data/priogrid/0.0.0.9000/naturalearth_cover.rds', probable reason 'No such file or directory'
#> Error in gzfile(file, "rb"): cannot open the connection