File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,11 @@ GeomDotplot <- proto(Geom, {
132
132
# Add back binaxis
133
133
stat_params <- c(stat_params , binaxis = params $ binaxis )
134
134
135
- # If position=="stack" or position is position_stack() (the test is kind of complex),
136
- # tell them to use stackgroups=TRUE instead
137
- if (! is.null(position ) && (position == " stack" || (is.proto(position ) && position $ objname == " stack" )))
135
+ # If identical(position, "stack") or position is position_stack() (the test
136
+ # is kind of complex), tell them to use stackgroups=TRUE instead. Need to
137
+ # use identical() instead of ==, because == will fail if object is
138
+ # position_stack() or position_dodge()
139
+ if (! is.null(position ) && (identical(position , " stack" ) || (is.proto(position ) && position $ objname == " stack" )))
138
140
message(" position=\" stack\" doesn't work properly with geom_dotplot. Use stackgroups=TRUE instead." )
139
141
140
142
if (params $ stackgroups && params $ method == " dotdensity" && params $ binpositions == " bygroup" )
You can’t perform that action at this time.
0 commit comments