From 05bfff51235234648fa89bf965c02774f622e5f9 Mon Sep 17 00:00:00 2001 From: MMenchero Date: Fri, 18 Oct 2024 17:06:35 -0600 Subject: [PATCH] fix: issue with Date objects --- R/nixtla_client_cross_validation.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/nixtla_client_cross_validation.R b/R/nixtla_client_cross_validation.R index af53c50..52c3d76 100644 --- a/R/nixtla_client_cross_validation.R +++ b/R/nixtla_client_cross_validation.R @@ -220,7 +220,7 @@ nixtla_client_cross_validation <- function(df, h=8, freq=NULL, id_col="unique_id window_starts <- seq(0, sum(unlist(resp$sizes)) - 1, by = h) cutoff_idxs <- rep(idxs[window_starts + 1] - 1, each = h) cutoff_dates <- df$ds[unique(cutoff_idxs)] - cutoff <- unlist(lapply(cutoff_dates, function(i) {rep(i, times = h)})) + cutoff <- do.call(c, sapply(cutoff_dates, function(i) rep(i, times = h), simplify = FALSE)) cutoff <- as.POSIXct(cutoff) dt <- data.frame(