Skip to content
Snippets Groups Projects
Commit f59aab67 authored by Mauricio Zambrano-Bigiarini's avatar Mauricio Zambrano-Bigiarini
Browse files

hydromod.R: unnecessary 'paste' comands removed

parent 13980b68
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ hydromod <- function( ...@@ -79,7 +79,7 @@ hydromod <- function(
############################################################################## ##############################################################################
if (!file.exists(param.files)) if (!file.exists(param.files))
stop( paste("Invalid argument: the file '", param.files, "' doesn't exist!", sep="") ) stop( "Invalid argument: the file '", param.files, "' doesn't exist!" )
# Verifying 'param.values' # Verifying 'param.values'
#if (missing(param.values)) #if (missing(param.values))
...@@ -98,7 +98,7 @@ hydromod <- function( ...@@ -98,7 +98,7 @@ hydromod <- function(
setwd(model.drty) setwd(model.drty)
if (!file.exists(exe.fname)) if (!file.exists(exe.fname))
stop( paste("Invalid argument: the file '", exe.fname, "' does not exist!", sep="") ) stop( "Invalid argument: the file '", exe.fname, "' does not exist!" )
if ( sessionInfo()[[1]]$os != "linux-gnu") { if ( sessionInfo()[[1]]$os != "linux-gnu") {
dot.pos <- which(strsplit(exe.fname, split=character(0))[[1]] == ".") dot.pos <- which(strsplit(exe.fname, split=character(0))[[1]] == ".")
...@@ -161,7 +161,7 @@ hydromod <- function( ...@@ -161,7 +161,7 @@ hydromod <- function(
if (!missing(gof.Fin) ) { if (!missing(gof.Fin) ) {
if (gof.Fin < gof.Ini) { if (gof.Fin < gof.Ini) {
stop( paste("Invalid argument: 'gof.Fin < gof.Ini' (", gof.Fin, " < ", gof.Ini, ")", sep="") ) stop( "Invalid argument: 'gof.Fin < gof.Ini' (", gof.Fin, " < ", gof.Ini, ")" )
} else { } else {
if (!is.zoo(obs)) { if (!is.zoo(obs)) {
stop( "Invalid argument: 'obs' must be a zoo or xts object to use 'gof.Fin' !" ) stop( "Invalid argument: 'obs' must be a zoo or xts object to use 'gof.Fin' !" )
...@@ -176,14 +176,14 @@ hydromod <- function( ...@@ -176,14 +176,14 @@ hydromod <- function(
nsim <- length(sim) nsim <- length(sim)
if (nobs != nsim) if (nobs != nsim)
stop( paste("Invalid argument: number of observations != number of simulations (", nobs, "!=", nsim, ")'", sep="") ) stop( "Invalid argument: number of observations != number of simulations (", nobs, "!=", nsim, ")'" )
gof.FUN.argsDefaults <- formals(gof.FUN) gof.FUN.argsDefaults <- formals(gof.FUN)
gof.FUN.args <- modifyList(gof.FUN.argsDefaults, gof.FUN.args) gof.FUN.args <- modifyList(gof.FUN.argsDefaults, gof.FUN.args)
gof.FUN.args <- modifyList(gof.FUN.args, list(sim=sim, obs=obs)) gof.FUN.args <- modifyList(gof.FUN.args, list(sim=sim, obs=obs))
gof.value <- do.call(gof.FUN, as.list(gof.FUN.args)) gof.value <- do.call(gof.FUN, as.list(gof.FUN.args))
if (verbose) message(paste("[", gof.name, "= ", round(gof.value,3), "]", sep="")) if (verbose) message("[", gof.name, "= ", round(gof.value,3), "]")
############################################################################## ##############################################################################
# 5) Creating the output object # # 5) Creating the output object #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment