Converts character vector of lengths, such as “3/4”, “nse”, “hd”, and “1 1/2”, into numeric vector.
conv_len(lengths)
param | details |
---|---|
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.