[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:
Bernie Gray
2017-06-15 23:56:23 -04:00
committed by Vadim Khotilovich
parent 0db37c05bd
commit cd7659937b
8 changed files with 23 additions and 23 deletions

View File

@@ -115,7 +115,7 @@ xgb.importance <- function(feature_names = NULL, model = NULL, trees = NULL,
} else {
data.table(Feature = rep(feature_names, each = num_class),
Weight = weights,
Class = 0:(num_class - 1))[order(Class, -abs(Weight))]
Class = seq_len(num_class) - 1)[order(Class, -abs(Weight))]
}
} else {
# tree model