A pipe-friendly version of units<-.magpie. Extension of set_units from the units package to MAgPIE objects.
set_magpie_units(x, value, manual_overwrite = FALSE)
MAgPIE object
object of class units, a character of length one coercible to units via as_units, or a MAgPIE object
boolean indicating whether to coerce the object into the provided unit. If FALSE (default), value must be convertible from x's original unit (or else an error will be thrown), and the data in x will be converted to the new unit if possible. If TRUE, value will replace the existing unit without altering the data.
MAgPIE object x converted to given unit (if possible)