Skip to contents

Adjust population raster to match values from shapefile

Usage

adjust_pop_by_shp(input_raster, ref_shp, col_name, output_class = "terra")

Arguments

input_raster

A SpatRaster (or RasterLayer) objects that will be adjusted such that the areal sums match the target column in ref_shp.

ref_shp

A sf polygon object.

col_name

A character string the identifies which column in ref_shp will be used to scale input_raster (this column must have numerical values and should not contain NAs).

output_class

Either "terra" (default) or "raster".

Value

a SpatRaster (or RasterLayer if output_class == "raster") object