Skip to content

Commit ab13b09

Browse files
committed
Help merge not mess with order.
Fixes #1520
1 parent 89f39c3 commit ab13b09

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ggplot2 2.0.0.9000
22

3+
* `stat_summary()` preserves sorted x order which avoids artefacts when
4+
display results with `geom_smooth()` (#1520).
5+
36
* All `geom_()` and `stat_()` function now have consistent argument order:
47
data + mapping, geom/stat/position, ..., specific arguments, common arguments
58
to all layers (#1305). This may break code if you were previously relying on

R/stat-summary.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ summarise_by_x <- function(data, summary, ...) {
167167
unique <- plyr::ddply(data, c("group", "x"), uniquecols)
168168
unique$y <- NULL
169169

170-
merge(summary, unique, by = c("x", "group"))
170+
merge(summary, unique, by = c("x", "group"), sort = FALSE)
171171
}
172172

173173
#' Wrap up a selection of summary functions from Hmisc to make it easy to use

0 commit comments

Comments
 (0)