From 9d582aebf80c8e755a91160da396ee97d20f6965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20Holl=C3=B3s?= Date: Tue, 5 Feb 2019 19:47:20 +0100 Subject: [PATCH] solving tmp bug in musoMonte --- RBBGCMuso/R/musoMonte.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RBBGCMuso/R/musoMonte.R b/RBBGCMuso/R/musoMonte.R index ba9ad0c..0bb315a 100644 --- a/RBBGCMuso/R/musoMonte.R +++ b/RBBGCMuso/R/musoMonte.R @@ -13,6 +13,7 @@ #' @param varIndex This parameter specifies which parameter will be used for the Monte Carlo experiment from the output list of Biome-BGCMuSo (defined by the INI file). You can extract this information from the INI files. At the output parameter specifications, the parameter order will determine this number. For example, if you have set these output parameters: 412, 874, 926, 888, and you want to use 926 for the experiment, you should specify varIndex as 3. #' @param debugging If you set this parameter, you can save every logfile, and RBBGCMuso will select those which contains errors. This is useful to study why the model crashes with a given parameter set. #' @param keepEpc If you set keepEpc as TRUE, it will save every selected EPC file, and move the wrong ones into the WRONGEPC directory. +#' @importFrom magrittr '%>%' #' @export musoMonte <- function(settings=NULL, @@ -112,12 +113,15 @@ musoMonte <- function(settings=NULL, moreCsv <- function(){ + settings$iniInput[2] %>% + (function(x) paste0(dirname(x),"/",tools::file_path_sans_ext(basename(x)),"-tmp.",tools::file_ext(x))) %>% + unlink randValues <- randVals[[2]] settings$calibrationPar <- randVals[[1]] ## randValues <- randValues[,randVals[[1]] %in% parameters[,2]][,rank(parameters[,2])] modellOut <- matrix(ncol = numVars, nrow = iterations + 1) - origModellOut <- calibMuso(silent=TRUE) + origModellOut <- calibMuso(settings=settings,silent=TRUE) write.csv(x=origModellOut, file=paste0(pretag,1,".csv")) if(!is.list(fun)){