Description Usage Arguments Details
All of the unit conversion functions are looking for a length-1 character vector. This function checks that these conditions are met.
1 | unitasserts(iunit, ounit)
|
iunit |
Input unit |
ounit |
Output unit |
The conditions are applied as assertions and will therefore cause errors rather than warnings if they fail. This a departure from our usual practice. We do it because having the wrong length or wrong type is a programming error, not a data error. Therefore, we expect these to trigger only in during testing new modules, in which case an error and immediate halt is appropriate.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.