From 2146d06a821994745ea0d4db5045e62acc7b7a11 Mon Sep 17 00:00:00 2001 From: Matthew Kay Date: Sat, 23 Dec 2023 12:51:43 -0600 Subject: [PATCH] fix bug in collapse_native_units when sum has a multiple --- R/utilities-unit.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utilities-unit.R b/R/utilities-unit.R index bfa4268274..c5d3e6041f 100755 --- a/R/utilities-unit.R +++ b/R/utilities-unit.R @@ -35,7 +35,7 @@ collapse_native_units <- function(x) { components <- collapse_native_units(unit_components(x_i)) is_native <- unitType(components) == "native" if (any(is_native)) { - x_i <- f(unit(f(as.numeric(components[is_native])), "native"), components[!is_native]) + unit_components(x_i) <- vec_c(unit(f(as.numeric(components[is_native])), "native"), components[!is_native]) } x_i })