Skip to contents

This method allows the homogenization of missing data across a set of environmental predictors. It is by default called when predictors are added to BiodiversityDistribution object. Only grid cells with NAs that contain values at some raster layers are homogenized. Additional parameters allow instead of homogenization to fill the missing data with neighbouring values

Usage

predictor_homogenize_na(
  env,
  fill = FALSE,
  fill_method = "ngb",
  return_na_cells = FALSE
)

Arguments

env

A SpatRaster object with the predictors.

fill

A logical value indicating whether missing data are to be filled (Default: FALSE).

fill_method

A character of the method for filling gaps to be used (Default: 'ngb').

return_na_cells

A logical value of whether the ids of grid cells with NA values is to be returned instead (Default: FALSE).

Value

A SpatRaster object with the same number of layers as the input.

Examples

if (FALSE) {
 # Harmonize predictors
 env <- predictor_homogenize_na(env)
}