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. See
vignette("addons", package = "fasterRaster")`.
Arguments
- x
Either
NULL
or a character specifying the name of a GRASS addons module. IfNULL
, the existence of theaddonsDir
(seefaster()
) 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. IfFALSE
, thenNULL
will be returned with a warning.- verbose
Logical: If
TRUE
(default), display a message on success or warning (thefail
option always displays a message).
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.")
}