Skip to content

Commit 66931c3

Browse files
committed
Merge pull request #770 from wch/summary-group
Fixes for stat_summary
2 parents 8f7c348 + f19a9c6 commit 66931c3

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ BUG FIXES
1515

1616
* Plots with geom_crossbar not display correct symbol in legend. (Fixes #768)
1717

18+
* Grouping is no longer set automatically by `stat_summary()`, allowing for
19+
summary paths. This reverts a change made for 0.9.3. (Fixes #732 and #739)
20+
1821
ggplot2 0.9.3
1922
----------------------------------------------------------------
2023

R/stat-summary.r

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ StatSummary <- proto(Stat, {
136136
}
137137
}
138138

139-
# Each x location should be in a separate group
140-
data$group <- as.integer(interaction(data$group, data$x))
141-
142139
summarise_by_x(data, fun, ...)
143140
}
144141

visual_test/stat-summary.r

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
vcontext("stat-summary")
2+
3+
ggplot(mtcars, aes(x = cyl, y = mpg, colour = factor(vs))) +
4+
geom_point() +
5+
stat_summary(fun.y = mean, geom="line", size = 2)
6+
save_vtest("summary with color and lines")
7+
8+
# It is not possible to make this behave as expected without breaking the
9+
# summary with color and lines, because of the way grouping works with
10+
# stat_summary.
11+
ggplot(mtcars, aes(x = cyl, y = mpg)) +
12+
geom_point() +
13+
stat_summary(fun.data=mean_cl_boot, colour="red", geom="crossbar", width=0.2)
14+
save_vtest("summary with crossbars, no grouping (looks wrong)")
15+
16+
ggplot(mtcars, aes(x = cyl, y = mpg, group = cyl)) +
17+
geom_point() +
18+
stat_summary(fun.data=mean_cl_boot, colour="red", geom="crossbar", width=0.2)
19+
save_vtest("summary with crossbars, manual grouping")
20+
21+
end_vcontext()

0 commit comments

Comments
 (0)