Skip to content

Commit

Permalink
fix duplicate detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Enchufa2 committed Feb 13, 2025
1 parent e0988ce commit 46e5fdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ c.units <- function(..., recursive = FALSE, allow_mixed = units_options("allow_m
if (length(args) == 1)
return(.as.units(NextMethod(), u))

dup <- c(TRUE, duplicated(lapply(args, units))[-1])
dup <- vapply(args, function(x) identical(units(x), u), TRUE)

if (all(dup))
return(.as.units(do.call(c, lapply(args, drop_units)), u))
Expand Down

0 comments on commit 46e5fdf

Please sign in to comment.