Skip to content

Commit

Permalink
minor bug in weighted mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mjskay committed Jan 6, 2024
1 parent d1bab64 commit 076f504
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/point_interval.R
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ Mode.default = function(x, na.rm = FALSE, ..., density = density_bounded(trim =
ux[which.max(tabulate(match(x, ux)))]
} else {
ux = unique(x)
ux_weights = vapply(split(weights, factor(ux, ux)), sum, numeric(1))
ux_weights = vapply(split(weights, factor(x, ux)), sum, numeric(1))
ux[which.max(ux_weights)]
}
} else {
Expand Down

0 comments on commit 076f504

Please sign in to comment.