Skip to content

Commit c6d6ef1

Browse files
authored
add drop = FALSE (#472)
1 parent aab5cf1 commit c6d6ef1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/commonMachineLearningRegression.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,10 +794,10 @@
794794
if (is.null(model)) {
795795
result <- switch(purpose, "regression" = jaspResults[["regressionResult"]]$object, "classification" = jaspResults[["classificationResult"]]$object)
796796
explainer <- result[["explainer"]]
797-
x_test <- result[["test"]][, predictors]
797+
x_test <- result[["test"]][, predictors, drop = FALSE]
798798
} else {
799799
explainer <- model[["explainer"]]
800-
x_test <- dataset[, predictors]
800+
x_test <- dataset[, predictors, drop = FALSE]
801801
predictions <- .mlPredictionsState(model, dataset, options, jaspResults, ready)[[1]][options[["fromIndex"]]:options[["toIndex"]]]
802802
}
803803
from <- min(c(options[["fromIndex"]], options[["toIndex"]] - 1, nrow(x_test)))

0 commit comments

Comments
 (0)