Description Usage Arguments Details Examples
Convert lengths from character vector, containing values like "3/4" and "hd" into a numeric vector.
1 |
lengths |
character vector of lengths |
This function makes some assumptions, so may need tweaking over time. For each string in a vector it is first split up by the spaces in it, so "1 3/4" is split into "1" "3/4", if there are no spaces then it assesses the single number/letters against a list of common length margins. If the split vector has length 2 then it assumes the first element is a whole number, and the second is a fraction (like "3/4"), it calculates the total margin. There is no doubt for edge cases that this function doesn't cover which will cause errors, the function was harder to write than initially thought, and will likely need improvements as edge cases are encountered
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.