bru_safe_terra: Check for potential 'terra' installation issues

View source: R/utils.R

bru_safe_terraR Documentation

Check for potential terra installation issues

Description

Loads the terra package with requireNamespace("terra", quietly = TRUE), and checks whether eval_spatial() successfully extracts non-NA values. NA values may appear when there is a GDAL/PROJ installation issue that causes it to not find the proj.db database file.

For use in package tests and examples that depend on terra.

Usage

bru_safe_terra(quietly = FALSE, minimum_version = "1.7-66")

Arguments

quietly

logical; if TRUE, prints diagnostic messages. Default FALSE

minimum_version

character; the minimum required version. Default 1.7-66 (should always match the requirement in the package DESCRIPTION)

Value

Returns (invisibly) FALSE if a potential issue is detected, and give a message if quietly is FALSE. Otherwise returns TRUE

Examples

## Not run: 
if (bru_safe_terra()) {
  # Run terra dependent calculations
}

## End(Not run)


inlabru documentation built on July 28, 2026, 9:07 a.m.