From 6d19ad1b8653eeb509a3717b899c709337ff00be Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Mon, 8 Sep 2014 23:11:22 -0700 Subject: [PATCH] only call remove.config if it exists --- utils/R/run.write.configs.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/R/run.write.configs.R b/utils/R/run.write.configs.R index dc8db52a27f..7fcf7c5ea35 100644 --- a/utils/R/run.write.configs.R +++ b/utils/R/run.write.configs.R @@ -59,7 +59,10 @@ run.write.configs <- function(settings, write = TRUE) { trait.samples <- sa.samples <- ensemble.samples <- env.samples <- runs.samples <- list() ## Prepare for model output. Cleanup any old config files (if exists) - do.call(paste("remove.config", model, sep="."), args = list(settings$rundir, settings)) + my.remove.config <- paste0("remove.config.",model) + if(exists(my.remove.config)) { + do.call(my.remove.config, args = list(settings$rundir, settings)) + } ## Load PFT priors and posteriors for (i in seq(pft.names)){