Learn R Programming

geostatsp (version 2.2.0)

inlaAvailable: Check whether INLA is usable

Description

Tests whether the INLA package is installed and its binaries work, and optionally sets INLA thread options.

Usage

inlaAvailable()
inlaSetThreads(num.threads = 2L)

Value

inlaAvailable returns a logical. inlaSetThreads returns TRUE if options were set, FALSE otherwise, invisibly.

Arguments

num.threads

Number of threads passed to INLA::inla.setOption.

Details

requireNamespace("INLA") can succeed even when the INLA program binaries are missing or broken. inlaAvailable additionally probes INLA::inla.getOption so examples and tests can skip safely. inlaSetThreads is a no-op when INLA is unavailable.

Examples

Run this code
inlaAvailable()
inlaSetThreads(2)

Run the code above in your browser using DataLab