Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

geom_dotplot: Properly handle position comparison. Fixes #709

  • Loading branch information...
commit 07f7364bfb12cc20354bccb093440eae30159b3b 1 parent 442500d
@wch wch authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 R/geom-dotplot.r
View
8 R/geom-dotplot.r
@@ -132,9 +132,11 @@ GeomDotplot <- proto(Geom, {
# Add back binaxis
stat_params <- c(stat_params, binaxis=params$binaxis)
- # If position=="stack" or position is position_stack() (the test is kind of complex),
- # tell them to use stackgroups=TRUE instead
- if (!is.null(position) && (position == "stack" || (is.proto(position) && position$objname == "stack")))
+ # If identical(position, "stack") or position is position_stack() (the test
+ # is kind of complex), tell them to use stackgroups=TRUE instead. Need to
+ # use identical() instead of ==, because == will fail if object is
+ # position_stack() or position_dodge()
+ if (!is.null(position) && (identical(position, "stack") || (is.proto(position) && position$objname == "stack")))
message("position=\"stack\" doesn't work properly with geom_dotplot. Use stackgroups=TRUE instead.")
if (params$stackgroups && params$method == "dotdensity" && params$binpositions == "bygroup")
Please sign in to comment.
Something went wrong with that request. Please try again.