Summarize downscale for plot inputs
summarize_downscale_output.Rd
This function will summarize downscale to prepare input for plots
Usage
summarize_downscale_output(
xyz = NULL,
gcms = list_gcms()[c(1, 4, 5, 6, 7, 10, 11, 12)],
ssps = list_ssps()[2],
max_run = 10L,
obs_years = list_obs_years(),
gcm_hist_years = list_gcm_hist_years(),
gcm_ssp_years = list_gcm_ssp_years(),
use_downscale_db = FALSE,
cache = TRUE,
vars = NULL,
downscale_results = NULL,
...
)
Arguments
- xyz
a
terra::SpatRaster
with a single layer containing elevation values in metres, or adata.frame
with the following columns "long", "lat", "elev", and a unique "id". Any extra columns will be ignored and not output.- gcms
character. Vector of global climate model names. Options are
list_gcms()
.- ssps
character. Vector of SSP-RCP scenarios (representative concentration pathways paired with shared socioeconomic pathways). Options are
list_ssps()
. Defaults to all scenarios available.- max_run
integer. Maximum number of model runs to include, not including the ensemble mean. Runs are included in the order they are found in the models data until
max_run
is reached. Defaults to 0L.- obs_years
integer. Vector of years to obtain individual years or time series of observational climate data. See
list_obs_years()
for available years.- gcm_hist_years
character. Timeseries years for GCM simulations of the historical scenario. See
list_gcm_hist_years()
for available years.- gcm_ssp_years
character. Timeseries years for GCM simulations of future scenarios specified by
ssps
. Seelist_gcm_ssp_years()
for available years.- use_downscale_db
Should the function
downscale_db
be used instead ofdownscale
- cache
logical. Cache data locally? Default
TRUE
- vars
character vector of the vars that needs to be summarize
- downscale_results
optional, if you want to pass precomputed downscale results
- ...
Additional arguments passed to
downscale
ordownscale_db
Value
A data.table containing averaged climate variables by period, including monthly temperature (average, min, max) and precipitation values (Tave, Tmin, Tmax, PPT) for each of the 12 months
Examples
if (FALSE) { # \dontrun{
in_xyz <- data.frame(lon = -127.7052, lat = 55.3557, elev = 291, id = 1)
summarize_downscale_output(in_xyz)
summarize_downscale_output(in_xyz, max_run = 1L,
gcm_hist_years = 1950:2015,
gcm_ssp_years = 2015:2040)
} # }