[R] many minor changes to increase the robustness of the R code (#2404)
* many minor changes to increase robustness of R code * fixing which mistake in xgb.model.dt.tree.R and a few cosmetics
This commit is contained in:
committed by
Vadim Khotilovich
parent
0db37c05bd
commit
cd7659937b
@@ -305,7 +305,7 @@ slice.xgb.DMatrix <- function(object, idxset, ...) {
|
||||
ind <- which(len == nr)
|
||||
if (length(ind) > 0) {
|
||||
nms <- names(attr_list)[ind]
|
||||
for (i in 1:length(ind)) {
|
||||
for (i in seq_along(ind)) {
|
||||
attr(ret, nms[i]) <- attr(object, nms[i])[idxset]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user