wbt_run_tool: Run a tool in 'WhiteboxTools' by name

View source: R/wbt.R

wbt_run_toolR Documentation

Run a tool in 'WhiteboxTools' by name

Description

Runs a tool and specifies tool arguments. If the prefix "whitebox::" or "wbt_" is in tool_name it is removed to match the definitions in wbt_list_tools()

Usage

wbt_run_tool(tool_name, args, verbose_mode = FALSE, command_only = FALSE)

Arguments

tool_name

The name of the tool to run.

args

Tool arguments.

verbose_mode

Verbose mode. Without this flag, tool outputs will not be printed.

command_only

Return command that would be run with system()? Default: FALSE

Value

Returns the (character) output of the tool.

See Also

wbt_list_tools

Examples

## Not run: 
tool_name <- "breach_depressions"
dem <- system.file("extdata", "DEM.tif", package="whitebox")
output <- "./output.tif"
arg1 <- paste0("--dem=", dem)
arg2 <- paste0("--output=", output)
args <- paste(arg1, arg2)
wbt_run_tool(tool_name, args)

## End(Not run)

giswqs/whiteboxR documentation built on Feb. 13, 2024, 6:16 p.m.