I generally use argparse in Python and docopt in R. One of the features I miss from argparse that I have not yet figured out in docopt is the ability to specify the required data type for each argument. For example, in argparse I would require an integer input using
parser.add_argument("square", help="display a square of a given number",
type=int)
In docopt / R, I can't find anything in the documentation about requiring a specific data type.
-s <square>, --square=<square> display a square of a given number #additional option to require integer input?
There's a closed issue on the Python version of docopt GitHub repo that seems to indicate that this is not a part of base docopt and offers a solution for Python, but this isn't directly applicable to R. Can anyone offer any suggestions / more elegant way to validate argument inputs using docopt in R?