FBartos / zcurve

zcurve R package for assessing the reliability and trustworthiness of published literature with the z-curve method
https://fbartos.github.io/zcurve
10 stars 1 forks source link

Misleading error message when empty vector is passed #22

Closed LukasWallrich closed 3 months ago

LukasWallrich commented 3 months ago

I use zcurve in an app, and took quite a long time to figure out what was going on in a case like the below - maybe there could be a less misleading/more explicit error message?

zcurve::zcurve(z = numeric(0))
#> Error in zcurve::zcurve(z = numeric(0)): 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])'

Created on 2024-05-23 with reprex v2.1.0

FBartos commented 3 months ago

Hi Lukas,

Thanks for reporting, I see the issue and I will fix the input check to also deal with zero length inputs.

Frantisek

FBartos commented 3 months ago

Does this error helps with debuging?

> zcurve::zcurve(z = numeric(0))
Error in zcurve::zcurve(z = numeric(0)) : 
  An empty input was passed as z-scores.
LukasWallrich commented 3 months ago

Perfect, thanks!

FBartos commented 3 months ago

It's on the way to CRAN.