On some number combinations the result of the initial_time_split generates a train/testing split different to what was intended. Seems the use of n_train = floor(x) within the function is driving this.
My script was generating the prop by using '1 - NROW(desired test set)/NROW(full data set)'. Using prop = NROW(desired training set )/NROW(full data set) does fix the issue so this isn't a major issue but still it caught me out. I guess I was interested in the reason for using floor(x) and not round(x, digits = 0)?
If you run the code below the result of NROW(testData) is 45, not 44.
data <- dplyr::as_tibble(c( rep("tr", 199), rep("te", 44) )) prop = 1 - (44/243) split <- rsample::initial_time_split(data = data, prop = prop) testData <- rsample::testing(split) NROW(testData)