Given a string or a fraction parsed using parse_fraction(), this function will check to see whether it is in its simplified form, and if not, it will convert it to a proper or mixed fraction, depending on whether the parsed number has a whole number component.

as_simplified(fraction)

Arguments

fraction

The input fraction, already parsed, or a string to be parsed using parse_fraction(fraction, improper = FALSE, reduce = TRUE).

Examples

as_simplified("17/2")
#> [1] "8 1/2"