diff --git a/DESCRIPTION b/DESCRIPTION index 21800d2..88afdce 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "f.bartos96@gmail.com", role = c("aut", "cre")), person("Ulrich", "Schimmack", email = "ulrich.schimmack@utoronto.ca", role = c("aut"))) diff --git a/NEWS.md b/NEWS.md index d86cc07..cd8d3d9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/R/main.R b/R/main.R index 8ec6603..bc05dca 100644 --- a/R/main.R +++ b/R/main.R @@ -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")){