This function takes a units object or a character string representing a unit expression and returns a simplified units object by canceling when possible its convertible terms.
Examples
# Using a units object
u <- units::set_units(1, "L*g/mg", mode = "standard")
simplify_unit(u)
#> 1000 [L]
# Using a character string
simplify_unit("(mg*L)/(mL)")
#> 1000 [mg]