The function create_intervals inside expand_intervals used by mimic_rate_cv calls the function trunc_time in order to truncate times after 6 hours. There are two issues here:
I am unsure whether a hard-coded truncation after 6 hours is sensible for a function that isn't MIMIC-specific. There might be something I am missing here but I think it would make sense to have expand_intervals take a max_len argument that then defaults to 6 hours.
The above is currently moot in any case, as trunc_time currently doesn't actually truncate. The replace function is currently never assigned back to the vector x.
The function
create_intervals
insideexpand_intervals
used bymimic_rate_cv
calls the functiontrunc_time
in order to truncate times after 6 hours. There are two issues here:expand_intervals
take amax_len
argument that then defaults to 6 hours.https://github.com/eth-mds/ricu/blob/7f2cc42503e003f4aea388847232e4157b7fc8ea/R/callback-itm.R#L414-L415
trunc_time
currently doesn't actually truncate. Thereplace
function is currently never assigned back to the vectorx
.https://github.com/eth-mds/ricu/blob/7f2cc42503e003f4aea388847232e4157b7fc8ea/R/utils-ts.R#L643-L654
This can be easily checked by running
which has a max length of 14 even after "truncating".