Learn R Programming

RSAGA (version 0.94-5)

rsaga.get.modules: Find SAGA libraries and modules

Description

These functions list the SAGA libraries (rsaga.get.libraries) and modules (rsaga.get.lib.modules, rsaga.get.modules) available in a SAGA installation, and allow to perform a full-text search among these functions.

Usage

rsaga.get.modules(libs, env = rsaga.env(), interactive = FALSE, parallel = env$parallel)
rsaga.get.libraries(path = rsaga.env()$modules, dll)
rsaga.get.lib.modules(lib, env = rsaga.env(), interactive = FALSE)
rsaga.module.exists(libs, module, env = rsaga.env(), ...)
rsaga.search.modules(text, modules, search.libs = TRUE, search.modules = TRUE, env = rsaga.env(), ignore.case = TRUE, ...)

Arguments

libs
character vector with the names of libraries in which to look for modules; if missing, all libraries will be processed
env
a SAGA geoprocessing environment as created by rsaga.env
interactive
logical (default FALSE): should modules be returned that can only be executed in interactive mode (i.e. using SAGA GUI)?
parallel
logical (defaults to env$parallel): if TRUE, run in parallel mode; requires a parallel backend such as doSNOW or doMC
path
path of SAGA library files (modules subfolder in the SAGA installation folder); defaults to the path determined by rsaga.env.
dll
file extension of dynamic link libraries
lib
character string with the name of the library in which to look for modules
module
module name or numeric code
...
currently only interactive to be passed on to rsaga.get.lib.modules
text
character string to be searched for in the names of available libraries and/or modules
modules
optional list: result of rsaga.get.modules; if missing, a list of available modules will be retrieved using that function
search.libs
logical (default TRUE); see search.modules
search.modules
logical (default TRUE): should text be searched for in library and/or module names?
ignore.case
logical (default FALSE): should the text search in library/module names be case sensitive?

Value

rsaga.get.libraries returns a character vector with the names of all SAGA libraries available in the folder env$modules.rsaga.get.lib.modules returns a data.frame with:
  • name the names of all modules in library lib,
  • code their numeric identifiers,
  • interactive and a logical variable indicating whether a module can only be executed in interactive (SAGA GUI) mode.
rsaga.get.modules returns a list with, for each SAGA library in libs, a data.frame with module information as given by rsaga.get.lib.modules. If libs is missing, all modules in all libraries will be retrieved.

See Also

rsaga.get.usage, rsaga.html.help, rsaga.geoprocessor, rsaga.env

Examples

Run this code
## Not run: 
# # make sure that 'rsaga.env' can find 'saga_cmd.exe'
# # before running this:
# rsaga.get.libraries()
# # list all modules in my favorite libraries:
# rsaga.get.modules(c("io_grid", "grid_tools", "ta_preprocessor",
#     "ta_morphometry", "ta_lighting", "ta_hydrology"))
# # list *all* modules (quite a few!):
# # rsaga.get.modules(interactive=TRUE)
# 
# # find modules that remove sink from DEMs:
# rsaga.search.modules("sink")
# # find modules that close gaps (no-data areas) in grids:
# rsaga.search.modules("gap")
# ## End(Not run)

Run the code above in your browser using DataLab