Defaults set to small floating point number cause validation error
Issue #22
resolved
Setting the default value of an argument to a floating point number small enough for R to automatically display in scientific format, leads to an argument type validation error.
Example:
> p <- add_argument(p, "--cutoff", default=0.0005, help="Example cutoff")
> args <- parse_args(p)
Error in (function (object, class, nargs) :
Invalid argument value: expecting numeric but got: (5e-04).
> p <- add_argument(p, "--cutoff", default=5e-4, help="Example cutoff")
> args <- parse_args(p)
Error in (function (object, class, nargs) :
Invalid argument value: expecting numeric but got: (5e-04).
Comments (2)
-
repo owner -
repo owner - changed status to resolved
Submitted to CRAN.
- Log in to comment
I can’t reproduce this.
gives
as expected.
Try updating your package to the master head following the README’s instructions – I have not released the updates yet.
I’ll prepare a new release soon.