Skip to contents

This function creates an empty copy of a provided SpatRaster object. It is primarily used in the package to create the outputs for the predictions.

Usage

emptyraster(x, ...)

Arguments

x

A SpatRaster* object corresponding.

...

other arguments that can be passed to terra

Value

an empty SpatRaster, i.e. all cells are NA.

Examples

require(terra)
#> Loading required package: terra
#> terra 1.7.71
r <- rast(matrix(1:100, 5, 20))
emptyraster(r)
#> class       : SpatRaster 
#> dimensions  : 5, 20, 1  (nrow, ncol, nlyr)
#> resolution  : 1, 1  (x, y)
#> extent      : 0, 20, 0, 5  (xmin, xmax, ymin, ymax)
#> coord. ref. :