This function is called by the pred_transfer module and can transfer predictions generated from a model to a new area of interest.

pred_transfer(country, fit, meta, covdf = NULL, aggdf = NULL, async = FALSE)

Arguments

country

character. ISO3 code of the country.

fit

disag_model. Object returned by disag_model function that contains all the necessary objects for generating predictions.

meta

list. The metadata object

covdf

dataframe. As produced by fileInput, containing name and datapath columns of covariates

aggdf

dataframe. As produced by fileInput, containing name and datapath columns of the aggregation raster

async

logical. Whether or not the function is being used asynchronously

Value

a list of SpatRaster objects

Author

Simon Smart simon.smart@cantab.net

Examples

common <- readRDS(system.file("extdata", "fit-minimal.rds", package = "disagapp"))
common$fit$data$covariate_rasters <- unwrap_terra(common$fit$data$covariate_rasters)
# transfer to Malawi
transfer <- pred_transfer("MWI", common$fit, common$meta)
#> 
|---------|---------|---------|---------|
=========================================