Commit 832876f9 authored by Dorchies David's avatar Dorchies David
Browse files

Merge branch...

Merge branch '152-createinputsmodel-specify-the-error-message-qobs-column-names-must-be-included-in-id-s-of-the' into 'dev'

Resolve "CreateInputsModel: Specify the error message: "'Qobs' column names must be included in 'id's of the GRiwrm object""

Closes #152

See merge request !95
2 merge requests!95Resolve "CreateInputsModel: Specify the error message: "'Qobs' column names must be included in 'id's of the GRiwrm object"",!93Draft: Version 0.7.0
Pipeline #57059 passed with stage
in 8 minutes and 15 seconds
Showing with 5 additions and 3 deletions
+5 -3
......@@ -106,7 +106,9 @@ CreateInputsModel.GRiwrm <- function(x, DatesR,
stop(sprintf(
"'%s' column names must be included in 'id's of the GRiwrm object",
varName
))
), "\n",
sprintf("These columns are not known: %s",
paste(colnames(v)[!colnames(v) %in% x$id], collapse = ", ")))
} else if (any(duplicated(colnames(v)))) {
stop(sprintf(
"'%s' has duplicated column names: '%s'",
......
......@@ -15,7 +15,7 @@
#' @examples
setUpCemaNeigeData <- function() {
data(L0123001)
data(L0123001, package = "airGR", envir = environment())
# Formatting observations for the hydrological models
# Each input data should be a matrix or a data.frame with the good id in the name of the column
......
......@@ -82,7 +82,7 @@ test_that("throws error on wrong column name", {
TempMean = l$TempMean,
ZInputs = l$ZInputs,
HypsoData = l$HypsoData),
regexp = "column names must be included in")
regexp = "column names must be included in.*Up0")
colnames(l$Precip) <- NULL
expect_error(CreateInputsModel(l$griwrm,
DatesR = l$DatesR,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment