Skip to content

Commit

Permalink
fix bug in collapse_native_units when sum has a multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
mjskay committed Dec 23, 2023
1 parent c6b2b6a commit 2146d06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/utilities-unit.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit 2146d06

Please sign in to comment.