Skip to content

Commit

Permalink
fix a nan
Browse files Browse the repository at this point in the history
  • Loading branch information
pearsonca committed Nov 7, 2024
1 parent 42a72c8 commit d244f20
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,14 @@ to_function <- function(x, bounds, interp_opts) {
kind <- callargs$kind
callargs$kind <- NULL
if (kind == "integral") {
ws <- diff(c(x[[1]], bounds[2]))
x[[2]] <- x[[2]]/ws
if (tail(x[[2]], 1) != 0) {
stop(sprintf(
"for integral data, the final entry should be 0; got instead: %s",
toString(tail(x[[2]], 1))
))
}
ws <- diff(x[[1]])
x[[2]] <- c(x[[2]]/ws, 0)
}
}
callargs$.usekind <- NULL
Expand Down

0 comments on commit d244f20

Please sign in to comment.