addons: Test if addons directory exists and if an addon is installed

View source: R/addons.r

addonsR Documentation

Test if addons directory exists and if an addon is installed

Description

This function tests to see if the "addons" directory specified using faster() actually exists, and if a particular GRASS ⁠addons module is available. The ⁠addons⁠folder and module must exists for methods that rely on particular **GRASS**⁠addons⁠to work. See⁠vignette("addons", package = "fasterRaster")'.

Usage

addons(x = NULL, fail = TRUE, verbose = TRUE)

Arguments

x

Either NULL or a character specifying the name of a GRASS addons module. If NULL, the existence of the addonsDir (see faster()) will be tested. If the module name is provided, the existence of the folder and module will be tested. The "⁠/bin⁠" subfolder should not be included.

fail

Logical: If TRUE (default), and the addons folder is not correctly specified, the exit the function with an error. If FALSE, then NULL will be returned with a warning.

verbose

Logical: If TRUE (default), display a message on success or warning (the fail option always displays a message).

Value

Logical.

See Also

vignette("addons", package = "fasterRaster")

Examples

if (grassStarted()) {

# Does the addons folder exist?
ao <- addons(fail = "warning")
if (ao) print("Addons is folder is probably correctly specified.")

# Does this particular module exist?
addon <- "v.centerpoint"
exten <- addons(addon, fail = FALSE)

if (exten) print("Extension `v.centerpoints` is installed.")

}

adamlilith/fasterRaster documentation built on Dec. 21, 2024, 2:04 a.m.