verbal-autopsy-software / InSilicoVA

R package for InSilicoVA framework
3 stars 6 forks source link

Bug: Plot argument "type" is not checked #24

Closed mjutras-mitre closed 4 years ago

mjutras-mitre commented 5 years ago

Bug: plot type argument should be checked. If the user mistakenly enters "type=dodg" as a parameter to the stackplot function call, they get the following cryptic error.

Error: Aesthetics must be either length 1 or the same as the data (6): fill, order

In this case, match.arg would be helpful or even pmatch for a partial match if we want to allow type="dodg"

https://github.com/verbal-autopsy-software/InSilicoVA/blob/7f770ac7ab8d82c1b9de25debc7e734f06273df8/InSilicoVA/R/groupplot.r#L80-L88