diff --git a/R-package/R/lgb.Dataset.R b/R-package/R/lgb.Dataset.R index 48a82847e4ed..6eb7e61d8980 100644 --- a/R-package/R/lgb.Dataset.R +++ b/R-package/R/lgb.Dataset.R @@ -87,7 +87,7 @@ Dataset <- R6::R6Class( private$categorical_feature <- categorical_feature private$predictor <- predictor private$free_raw_data <- free_raw_data - private$used_indices <- used_indices + private$used_indices <- sort(used_indices, decreasing = FALSE) private$info <- info }, @@ -481,7 +481,7 @@ Dataset <- R6::R6Class( private$categorical_feature, private$predictor, private$free_raw_data, - idxset, + sort(idxset, decreasing = FALSE), NULL, ...)