From 0f4c160e6b89b0eef749caacc00fd2f3f1437828 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 26 Jul 2023 14:54:24 +0200 Subject: [PATCH] check args --- R/report_s.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/report_s.R b/R/report_s.R index 57c3b9e9..711b2c06 100644 --- a/R/report_s.R +++ b/R/report_s.R @@ -16,6 +16,9 @@ report_s <- function(s = NULL, p = NULL) { if ((is.null(s) && is.null(p)) || (is.na(s) && is.na(p))) { insight::format_error("You must provide either `s` or `p`.") } + if (length(s) > 1 || length(p) > 1) { + insight::format_error("You must provide a single value for `s` or `p`.") + } # make sure we have both s and p if (!is.null(p) && !is.na(p)) { s <- -log2(p)