Skip to content

Commit 0058fd4

Browse files
committed
replace apply() with storage.mode() for integer to numeric matrix conversion
1 parent a86c556 commit 0058fd4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

R/helpers-ppc.R

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,7 @@ validate_predictions <- function(predictions, n_obs = NULL) {
7373
}
7474

7575
if (is.integer(predictions)) {
76-
if (nrow(predictions) == 1) {
77-
predictions[1, ] <- as.numeric(predictions[1,, drop = FALSE])
78-
}
79-
else {
80-
predictions <- apply(predictions, 2, as.numeric)
81-
}
76+
storage.mode(predictions) <- "numeric"
8277
}
8378

8479
if (anyNA(predictions)) {

0 commit comments

Comments
 (0)