Skip to content

Commit

Permalink
check args
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 26, 2023
1 parent 67a7f92 commit 0f4c160
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/report_s.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0f4c160

Please sign in to comment.