Skip to contents

This function tests to see if the "addons" directory specified using faster() actually exists, and if a particular GRASS addons module is available. The addonsfolder and module must exists for methods that rely on particular **GRASS**addonsto work. Seevignette("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.

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.")

}