From eef1695fdac1447333644ca1bdb9932472a84405 Mon Sep 17 00:00:00 2001 From: nperez Date: Wed, 28 Oct 2020 12:55:55 +0100 Subject: [PATCH] fix condition --- R/Load.R | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/R/Load.R b/R/Load.R index b5600af2..9feec5d3 100644 --- a/R/Load.R +++ b/R/Load.R @@ -2314,16 +2314,25 @@ Load <- function(var, exp = NULL, obs = NULL, sdates, nmember = NULL, } else { origin <- 0 } + dates[["start"]] <- do.call(c, lapply(sdates, + function(x) { + do.call(c, lapply((origin:(origin + number_ftime - 1)) * sampleperiod, + function(y) { + addTime(as.POSIXct(x, format = "%Y%m%d", tz = "UTC"), + store_period, y + leadtimemin - 1) + })) + })) } else { origin <- 0 - } - dates[["start"]] <- do.call(c, lapply(sdates, + dates[["start"]] <- do.call(c, lapply(sdates, function(x) { - do.call(c, lapply((origin:(origin + number_ftime - 1)) * sampleperiod, + do.call(c, lapply((0:(number_ftime - 1)) * sampleperiod, function(y) { - addTime(as.POSIXct(x, format = "%Y%m%d", tz = "UTC"), store_period, y + leadtimemin - 1) + addTime(as.POSIXct(x, format = "%Y%m%d", tz = "UTC"), + store_period, y + leadtimemin - 1) })) })) + } attr(dates[["start"]], "tzone") <- "UTC" # end is similar to start, but contains the end dates of each forecast # time step -- GitLab