Skip to contents

Call TauDEM

Usage

taudem_exec(
  program,
  args,
  ...,
  n_processes = getOption("traudem.n_processes", 1),
  quiet = getOption("traudem.quiet", FALSE)
)

Arguments

program

TauDEM command (character). See examples.

args

Character vector of arguments. See examples.

...

These dots are for future extensions and must be empty. As a consequence, all following arguments must be fully named (see examples).

n_processes

Number of processes for mpiexec. If NULL TauDEM is called without mpiexec.

quiet

If FALSE output from TauDEM CLI is suppressed.

Value

TRUE if the call was successful, FALSE otherwise.

Details

You can use this function to call more TauDEM methods than the ones with dedicated wrappers in this package. Please refer to the relative TauDEM function documentation for the syntax used to specify optional arguments. See also examples.

Examples

if (FALSE) { # interactive() && traudem::can_register_taudem()
test_dir <- withr::local_tempdir()
dir.create(test_dir)
file.copy(
   system.file("test-data", "DEM.tif", package = "traudem"),
   file.path(test_dir, "DEM.tif")
 )
 # Default name for output file, only input command and input filename.
taudem_exec("pitremove", file.path(test_dir, "DEM.tif"))

# syntax for user-attributed output file name
taudem_exec(
  "pitremove",
  c(
    "-z", file.path(test_dir, "DEM.tif"),
    "-fel", file.path(test_dir,"filled_pits.tif")
  )
)
}