better error handling

This commit is contained in:
hollorol 2018-02-19 13:00:04 +01:00
parent 233ec2bf56
commit 20deb229c2
2 changed files with 11 additions and 2 deletions

View File

@ -36,6 +36,16 @@ calibMuso <- function(settings,parameters=NULL, timee="d", debugging=FALSE, logf
epc <- settings$epcinput epc <- settings$epcinput
calibrationpar <- settings$calibrationpar calibrationpar <- settings$calibrationpar
whereAmI<-getwd() whereAmI<-getwd()
##########################################################################
###########################Defining Functions########################
########################################################################
############################################################# #############################################################
############################spinup run############################ ############################spinup run############################

View File

@ -1,4 +1,3 @@
#' This is the function which is capable change multiple specific lines to other using their row numbers. #' 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. #' he function uses the previous changspecline function to operate.
@ -14,7 +13,7 @@ changemulline <- function(filename,calibrationpar,contents){
varnum <- length(calibrationpar) varnum <- length(calibrationpar)
if(length(contents)!=varnum) 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) TOT=readLines(filename,-1)