Output:
Error: Variable 'y': Input had length 0, but must have length 1 or greater.
This is fine - we know which of our inputs is causing the error, and how this looks.
When we do this in the standard-specific function, we get the same error:
ig_nbs_ffmfga_value2centile(fat_free_mass_g = numeric(), gest_days = 270, sex = "M")
Output:
Error: Variable 'y': Input had length 0, but must have length 1 or greater.
This tells us our y variable is the culprit, but the actual argument name is fatfree_mass_g, not y. This needs changing, probably through changes to how each standard-specific conversion function interfaces with the validate_ig_nbs()-style input checking functions.
Errors are currently unique and helpful, but not as much as possible.
For example consider this error for zero-length input:
Output:
Error: Variable 'y': Input had length 0, but must have length 1 or greater.
This is fine - we know which of our inputs is causing the error, and how this looks.
When we do this in the standard-specific function, we get the same error:
Output:
Error: Variable 'y': Input had length 0, but must have length 1 or greater.
This tells us our
y
variable is the culprit, but the actual argument name isfatfree_mass_g
, noty
. This needs changing, probably through changes to how each standard-specific conversion function interfaces with thevalidate_ig_nbs()
-style input checking functions.