Skip to content

Commit

Permalink
fix: #22
Browse files Browse the repository at this point in the history
  • Loading branch information
FBartos committed May 23, 2024
1 parent 51e4f69 commit 3d8454b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: zcurve
Title: An Implementation of Z-Curves
Version: 2.4.1
Version: 2.4.2
Authors@R: c(
person("František", "Bartoš", email = "[email protected]", role = c("aut", "cre")),
person("Ulrich", "Schimmack", email = "[email protected]", role = c("aut")))
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## version 2.4.2
- Fixes https://github.com/FBartos/zcurve/issues/22

## version 2.4.1
- Fixes ODR computation with censored data

Expand Down
10 changes: 7 additions & 3 deletions R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,23 @@ zcurve <- function(z, z.lb, z.ub, p, p.lb, p.ub, data, method = "EM", boot
if(missing(z) & missing(p) & missing(z.lb) & missing(p.lb))
stop("No data input")
if(!missing(z)){
if(length(z) == 0)
stop("An empty input was passed as z-scores.")
if(!is.numeric(z))
stop("Wrong z-scores input: Data are not nummeric.")
if(!is.vector(z))
stop("Wrong z-scores input: Data are not a vector")
stop("Wrong z-scores input: Data are not a vector.")
if(all(z <= 1 & z >= 0))
stop("It looks like you are entering p-values rather than z-scores. To use p-values, explicitly name your argument 'zcurve(p = [vector of p-values])'")
stop("It looks like you are entering p-values rather than z-scores. To use p-values, explicitly name your argument 'zcurve(p = [vector of p-values])'.")
input_type <- c(input_type, "z")
}
if(!missing(p)){
if(length(p) == 0)
stop("An empty input was passed as p-values.")
if(!is.numeric(p))
stop("Wrong p-values input: Data are not nummeric.")
if(!is.vector(p))
stop("Wrong p-values input: Data are not a vector")
stop("Wrong p-values input: Data are not a vector.")
input_type <- c(input_type, "p")
}
}else if(inherits(data, "zcurve_data")){
Expand Down

0 comments on commit 3d8454b

Please sign in to comment.