@@ -845,16 +845,18 @@ gg2list <- function(p) {
845
845
not.merged <- not.merged [- 1 ]
846
846
# Are there any traces that have not yet been merged, and can be
847
847
# merged with tr?
848
- can.merge <- rep( FALSE , l = length(not.merged ))
848
+ can.merge <- logical ( length(not.merged ))
849
849
for (other.i in seq_along(not.merged )){
850
850
other <- not.merged [[other.i ]]
851
851
criteria <- c()
852
852
for (must.be.equal in c(" x" , " y" , " xaxis" , " yaxis" )){
853
853
other.attr <- other [[must.be.equal ]]
854
854
tr.attr <- tr [[must.be.equal ]]
855
- criteria [[must.be.equal ]] <- isTRUE(all.equal(other.attr , tr.attr ))
855
+ criteria [[must.be.equal ]] <-
856
+ isTRUE(all.equal(other.attr , tr.attr )) &&
857
+ unique(other $ type , tr $ type ) == " scatter"
856
858
}
857
- if (all(criteria ) && tr $ type != " bar " ){
859
+ if (all(criteria )){
858
860
can.merge [[other.i ]] <- TRUE
859
861
}
860
862
}
@@ -866,7 +868,7 @@ gg2list <- function(p) {
866
868
}, error = function (e ){
867
869
NA
868
870
})
869
- if (is.character(new.mode ) && ! is.na(new.mode )){
871
+ if (is.character(new.mode ) && ! is.na(new.mode % || % NA )){
870
872
tr $ mode <- new.mode
871
873
}
872
874
attrs <- c(" error_x" , " error_y" , " marker" , " line" )
0 commit comments