Skip to contents

Imports all rasters of a given extension type from a specified directory using terra::rast. Based on seegSDM::importRasters.

Usage

import_rasts(path, ext = ".grd", as_list = FALSE)

Arguments

path

Directory path containing rasters

ext

Extension type

as_list

logical Should the spatRaster objects be returned as a list (TRUE) or concatenated as layers in a single SpatRaster object (FALSE; default)

Value

A SpatRaster if as_list = FALSE, or list of SpatRaster objects.

Examples

if (FALSE) { # \dontrun{
  rasters <- import_rasts("/data/grids/covariates")
} # }