From afcaa12e60cbbd0bc72ef10c5953f8e2f1f4331c Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Tue, 3 Oct 2023 21:52:31 -0500 Subject: [PATCH] binomProbs only needs to be numeric --- R/utils.R | 2 +- src/utilcpp.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/R/utils.R b/R/utils.R index c1281ffb3..1b667482f 100644 --- a/R/utils.R +++ b/R/utils.R @@ -927,7 +927,7 @@ binomProbs <- function(x, ...) { #' @export binomProbs.default <- function(x, probs=c(0.025, 0.05, 0.5, 0.95, 0.975), na.rm=FALSE, names=TRUE, onlyProbs=TRUE) { - checkmate::assertIntegerish(x, min.len=1, lower=0.0, upper=1.0) + checkmate::assertNumeric(x, min.len=1, lower=0.0, upper=1.0) x <- as.double(x) checkmate::assertNumeric(probs, min.len=1, any.missing = FALSE, lower=0.0, upper=1.0) checkmate::assertLogical(na.rm, any.missing=FALSE, len=1) diff --git a/src/utilcpp.cpp b/src/utilcpp.cpp index 465f57a87..3dcb097bd 100644 --- a/src/utilcpp.cpp +++ b/src/utilcpp.cpp @@ -178,7 +178,6 @@ NumericVector binomProbs_(NumericVector x, NumericVector probs, bool naRm) { ret[2] = sd; ret[3] = (double)n; - double c = sd/sqrt((double)(n)); for (int i = 0; i < probs.size(); ++i) { double p = probs[i]; std::string str = std::to_string(p*100) + "%";