Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions R/gompred.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#' @param strategy strategy identifier. Must be one of 0 (do nothing), 1
#' (length-driven strategy), 2 (budget-driven strategy), or 3 (optimised
#' strategy).")
#' @param no.iff logical whether to let Gompitz use iff values
#' (\code{no.iff = FALSE}, the default) or not (\code{no.iff = TRUE})
#' @param \dots arguments passed to the corresponding
#' \code{.fileContentStrategy} functions, such as \code{range.years}
#' (two-element vector with first and last year of prediction),
Expand Down Expand Up @@ -39,8 +41,8 @@
#' # For an example, see the Tutorial vignette "How to Use the Package"
#'
runGompitzPrediction <- function(
input.data, subset = NULL, calibration, strategy = 0, ..., verbose = 1,
do.stop = TRUE, clear.observations = TRUE,
input.data, subset = NULL, calibration, strategy = 0, no.iff = FALSE, ...,
verbose = 1, do.stop = TRUE, clear.observations = TRUE,
VERSION = getOperatingSystemType(),
use.data.table = getOption("kwbGompitz.use.data.table", FALSE)
)
Expand Down Expand Up @@ -156,6 +158,7 @@ runGompitzPrediction <- function(
input.file = paths$input.file,
sep = sep,
strategy = strategy,
no.iff = no.iff,
verbose = verbose,
VERSION = VERSION
))
Expand Down
7 changes: 5 additions & 2 deletions R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ runGompcalInDirectory <- function(
#' @param input.file path to input file
#' @param sep column separator
#' @param strategy integer number specifying the strategy to be applied
#' @param no.iff logical whether to let Gompitz use iff values
#' (\code{no.iff = FALSE}, the default) or not (\code{no.iff = TRUE})
#' @param \dots arguments that are passed to .runModuleInDirectory, such as
#' \code{verbose} or \code{show.error}
#'
runGompredInDirectory <- function(
target.dir = tempdir(), input.file = exampleFile("obs.txt"), sep = ";",
strategy = 0, ...
strategy = 0, no.iff = FALSE, ...
)
{
error_code <- .runModuleInDirectory(
"gompred", target.dir, input.file, sep, ...,
options = as.character(strategy)
options = c(as.character(strategy), if (no.iff) "1" else NULL)
)

# Check the output for an error message
Expand Down Expand Up @@ -140,6 +142,7 @@ open_file_if_not_on_unix <- function(file)
files <- file.path("log", sprintf("%s_%s.txt", module, c("out", "err")))

.catLogMessageIf(verbose > 1, sprintf("command: '%s'\n", command))

kwb.utils::printIf(verbose > 1, args)

error_code <- system2(command, args, stdout = files[1], stderr = files[2])
Expand Down
5 changes: 4 additions & 1 deletion man/runGompitzPrediction.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/runGompredInDirectory.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.