Skip to content

Commit

Permalink
Fix some ::check() issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Oct 27, 2023
1 parent f95fb27 commit ce220c1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
11 changes: 9 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,13 @@ meanProbs.default <- function(x, probs=seq(0, 1, 0.25), na.rm=FALSE,
#' interval, this represents the number of observations used in the
#' input ("true") distribution.
#'
#' @param pred Use a prediction interval instead of a confidence
#' interval. By default this is `FALSE`.
#'
#' @param m integer. When using the prediction interval this
#' represents the number of samples that will be observed in the
#' future for the prediction interval.
#'
#' @param piMethod gives the prediction interval method (currently only lim) from Lu 2020
#'
#' @param M number of simulations to run for the LIM PI.
Expand Down Expand Up @@ -1005,7 +1012,7 @@ binomProbs.default <- function(x, probs=c(0.025, 0.05, 0.5, 0.95, 0.975), na.rm=
if (pred) {
.m <- mean(x, na.rm=na.rm)
if (is.na(.m)) {
.ret <- quantile(NULL,probs=probs)
.ret <- stats::quantile(NULL,probs=probs)
if (!onlyProbs) {
.ret <- c("mean"=NA_real_,"var"=NA_real_, "sd"=NA_real_, "n"=NA_real_,
.ret)
Expand All @@ -1015,7 +1022,7 @@ binomProbs.default <- function(x, probs=c(0.025, 0.05, 0.5, 0.95, 0.975), na.rm=
if (n == 0L) n <- as.integer(.nC)
if (m == 0L) m <- as.integer(.nC)
.Y <- round(.nC * .m) # number of successes
.ret <- quantile(.Call(`_rxode2_binomProbsPredVec_`, n, m, .Y, M, TRUE, tol),
.ret <- stats::quantile(.Call(`_rxode2_binomProbsPredVec_`, n, m, .Y, M, TRUE, tol),
probs=probs)
if (!onlyProbs) {
.ret <- c("mean"=.m,"var"=.m * (1.0 - .m), "sd"=sqrt(.m * (1.0 - .m)), "n"=.nC,
Expand Down
7 changes: 7 additions & 0 deletions man/binomProbs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/reexports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/rxode2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce220c1

Please sign in to comment.