Skip to content

Commit 9d4bb38

Browse files
committed
be robust about column orders in importance_frame; fixes #3
1 parent af013ea commit 9d4bb38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/measure_importance.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ important_variables <- function(importance_frame, k = 15, measures = names(impor
186186
frankv(importance_frame$mean_min_depth, ties.method = "dense"),
187187
p_value =
188188
frankv(importance_frame$p_value, ties.method = "dense"),
189-
apply(importance_frame[, -c(1, 2, 8)], 2,
189+
apply(importance_frame[, !colnames(importance_frame) %in% c("variable", "mean_min_depth", "p_value")], 2,
190190
function(x) frankv(x, order = -1, ties.method = "dense")))
191191
rankings$index <- rowSums(rankings[, measures])
192192
vars <- as.character(rankings[order(rankings$index), "variable"])[1:min(k, nrow(rankings))]

0 commit comments

Comments
 (0)