Permalink
Browse files

stat_summary: set different groups at each x. Fixes #622

  • Loading branch information...
1 parent 51ef455 commit f2f5e8c629813b280d61bb387615468458300331 @wch wch committed Aug 17, 2012
Showing with 6 additions and 0 deletions.
  1. +2 −0 NEWS
  2. +4 −0 R/stat-summary.r
View
2 NEWS
@@ -24,6 +24,8 @@ BUG FIXES
* When using `coord_map` with some projections, latitude lines wrapped
around the globe and added extra lines. (Winston Chang. Fixes #562)
+* `stat_summary` now calculates a unique value at each x. (Winston
+ Chang. Fixes #622)
ggplot2 0.9.2
----------------------------------------------------------------
View
4 R/stat-summary.r
@@ -135,6 +135,10 @@ StatSummary <- proto(Stat, {
as.data.frame(res)
}
}
+
+ # Each x location should be in a separate group
+ data$group <- as.integer(interaction(data$group, data$x))
+
summarise_by_x(data, fun, ...)
}

0 comments on commit f2f5e8c

Please sign in to comment.