Skip to content

Commit

Permalink
Improve check for max in plot.dist_spec (#896)
Browse files Browse the repository at this point in the history
* Improve check for max in dist_spec

* Add NEWs item
  • Loading branch information
jamesmbaazam authored Dec 12, 2024
1 parent bb45bb2 commit 32cc3bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- A bug was fixed where the initial growth was never estimated (i.e. the prior mean was always zero). By @sbfnk in #853 and reviewed by @seabbs.
- A bug was fixed where an internal function for applying a default cdf cutoff failed due to a difference a vector length issue. By @jamesmbaazam in #858 and reviewed by @sbfnk.
- All parameters have been changed to the new parameter interface. By @sbfnk in #871 and reviewed by @seabbs.
- A bug was fixed where `plot.dist_spec()` wasn't throwing an informative error due to an incomplete check for the max of the specified delay. By @jamesmbaazam in #858 and reviewed by @.

## Package changes

Expand Down
2 changes: 1 addition & 1 deletion R/dist_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ plot.dist_spec <- function(x, samples = 50L, res = 1, cumulative = TRUE, ...) {
cdf_cutoff <- 0
}
pmf_dt <- lapply(dists, function(y) {
if (is.infinite(attr(y, "max"))) {
if (is.infinite(max(y))) {
cli_abort(
c(
"!" = "All distributions in {.var x} must have a finite
Expand Down

0 comments on commit 32cc3bf

Please sign in to comment.