Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# bayesplot (development version)

* Replace `apply()` with `storage.mode()` for integer-to-numeric matrix conversion in `validate_predictions()`.
* Fixed `is_chain_list()` to correctly reject empty lists instead of silently returning `TRUE`.
* Added unit tests for `mcmc_areas_ridges_data()`, `mcmc_parcoord_data()`, and `mcmc_trace_data()`.
* Added unit tests for `ppc_error_data()` and `ppc_loo_pit_data()` covering output structure, argument handling, and edge cases.
Expand Down
7 changes: 1 addition & 6 deletions R/helpers-ppc.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,7 @@ validate_predictions <- function(predictions, n_obs = NULL) {
}

if (is.integer(predictions)) {
if (nrow(predictions) == 1) {
predictions[1, ] <- as.numeric(predictions[1,, drop = FALSE])
}
else {
predictions <- apply(predictions, 2, as.numeric)
}
storage.mode(predictions) <- "numeric"
}

if (anyNA(predictions)) {
Expand Down
Loading