From 20deb229c2940187a76228d1082a50548c6ed46d Mon Sep 17 00:00:00 2001 From: hollorol Date: Mon, 19 Feb 2018 13:00:04 +0100 Subject: [PATCH] better error handling --- RBBGCMuso/R/calibMuso.R | 10 ++++++++++ RBBGCMuso/R/changeMuso.R | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/RBBGCMuso/R/calibMuso.R b/RBBGCMuso/R/calibMuso.R index fe501f2..9757361 100644 --- a/RBBGCMuso/R/calibMuso.R +++ b/RBBGCMuso/R/calibMuso.R @@ -36,6 +36,16 @@ calibMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logf epc <- settings$epcinput calibrationpar <- settings$calibrationpar whereAmI<-getwd() + + + +########################################################################## +###########################Defining Functions######################## +######################################################################## + + + + ############################################################# ############################spinup run############################ diff --git a/RBBGCMuso/R/changeMuso.R b/RBBGCMuso/R/changeMuso.R index 386ae5a..03cbf2b 100644 --- a/RBBGCMuso/R/changeMuso.R +++ b/RBBGCMuso/R/changeMuso.R @@ -1,4 +1,3 @@ - #' This is the function which is capable change multiple specific lines to other using their row numbers. #' #' he function uses the previous changspecline function to operate. @@ -14,7 +13,7 @@ changemulline <- function(filename,calibrationpar,contents){ varnum <- length(calibrationpar) if(length(contents)!=varnum) { - cat("Error: number of the values is not the same as the number of the changed parameters") + stop(" number of the values is not the same as the number of the changed parameters") } TOT=readLines(filename,-1)