File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,11 @@ robyn_refresh <- function(json_file = NULL,
230230 totalDates <- as.Date(dt_input [, InputCollectRF $ date_var ][[1 ]])
231231 refreshStart <- InputCollectRF $ window_start <- as.Date(InputCollectRF $ window_start ) + InputCollectRF $ dayInterval * refresh_steps
232232 refreshStartWhich <- InputCollectRF $ rollingWindowStartWhich <- which.min(abs(difftime(totalDates , refreshStart , units = " days" )))
233- refreshEnd <- InputCollectRF $ window_end <- as.Date(InputCollectRF $ window_end ) + InputCollectRF $ dayInterval * refresh_steps
233+ if (InputCollectRF $ window_end %in% totalDates ) {
234+ refreshEnd <- InputCollectRF $ window_end <- as.Date(InputCollectRF $ window_end ) + InputCollectRF $ dayInterval * refresh_steps
235+ } else {
236+ refreshEnd <- InputCollectRF $ window_end <- as.Date(InputCollectRF $ window_end ) + 1
237+ }
234238 refreshEndWhich <- InputCollectRF $ rollingWindowEndWhich <- which.min(abs(difftime(totalDates , refreshEnd , units = " days" )))
235239 InputCollectRF $ rollingWindowLength <- refreshEndWhich - refreshStartWhich + 1
236240 }
You can’t perform that action at this time.
0 commit comments