-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Labels
featurea feature request or enhancementa feature request or enhancement
Description
It might be helpful to include the dates of the start/end of the in/out sample periods in the output of sliding_period(). This would also allow users to join the rsampling table with the Slice01, Slice02, etc labels to see a time series.
df <- data.frame(x = vctrs::new_date(c(1, 3, 4, 6, 7, 10)))
x <- sliding_period(df, x, "day", lookback = 2, assess_stop = 2, step = 2)
x$in_start_date = df$x[purrr::map_vec(x$splits, .f = function(x) min(x$in_id) )]
x$in_end_date = df$x[purrr::map_vec(x$splits, .f = function(x) max(x$in_id) )]
# Sliding period resampling
# A tibble: 2 × 4
splits id in_start_date in_end_date
<list> <chr> <date> <date>
1 <split [2/1]> Slice1 1970-01-02 1970-01-04
2 <split [2/1]> Slice2 1970-01-05 1970-01-07 gacolitti
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement