Skip to content

Commit

Permalink
binomProbs only needs to be numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Oct 4, 2023
1 parent b54c630 commit afcaa12
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/utilcpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) + "%";
Expand Down

0 comments on commit afcaa12

Please sign in to comment.