Skip to content

Commit

Permalink
Replace \() shorthand with function to remove dependency on R 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aadler committed Jan 31, 2025
1 parent fbf8a0e commit fd6be71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/mom.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ mommb <- function(x, maxit = 100L, tol = .Machine$double.eps ^ 0.5,
while (!converged && i < maxit) {
i <- i + 1L
oldg <- g
intxsqrd <- tryCatch(integrate(\(x) x ^ 2 * dmb(x, g, b), lower = 0,
upper = 1, subdivisions = 1000L,
intxsqrd <- tryCatch(integrate(function(x) {x ^ 2 * dmb(x, g, b)},
lower = 0, upper = 1, subdivisions = 1000L,
rel.tol = tol)$value,
error = \(cond) simpleError(trimws(cond$message)))
if (inherits(intxsqrd, "simpleError")) {
Expand Down

0 comments on commit fd6be71

Please sign in to comment.