Similar as partial this function calculates a partial response
of a trained model for a given variable. Differently from partial in space.
However the result is a `SpatRaster`

showing the spatial magnitude of the
partial response.

## Usage

```
spartial(mod, x.var, constant = NULL, plot = FALSE, ...)
# S4 method for ANY,character,ANY,logical
spartial(mod,x.var,constant,plot,...)
# S3 method for DistributionModel
spartial(mod, ...)
```

## Arguments

- mod
A

`DistributionModel`

object with trained model.- x.var
A character indicating the variable for which a partial effect is to be calculated.

- constant
A numeric constant to be inserted for all other variables. Default calculates the mean per variable.

- plot
A logical indication of whether the result is to be plotted?

- ...
Other engine specific parameters.

## Value

A SpatRaster containing the mapped partial response of the variable.

## Details

By default the mean is calculated across all parameters that are
not `x.var`

. Instead a *constant* can be set (for instance `0`

)
to be applied to the output.