ggobi / ggally

R package that extends ggplot2
http://ggobi.github.io/ggally/
584 stars 119 forks source link

failure in basic ggpairs example with GGally 2.20/ggplot2 3.4.4.9000/r-devel #481

Closed bbolker closed 7 months ago

bbolker commented 8 months ago

I'm guessing there is some incompatibility here that may be resolved with a version update, but haven't dug in yet ...

I suspect this has to do with all the changes in the development version of ggplot2, e.g. here, but ... ??? (don't see anything in the R NEWS file that would suggest that this is an r-devel issue ...)

packageVersion("GGally"); packageVersion("ggplot2")
## [1] ‘2.2.0’
## [1] ‘3.4.4.9000’
data(flea)
ggpairs(flea, columns = 2:4)

Error in as.character(call[[1]]) : cannot coerce type 'closure' to vector of type 'character'

traceback()
11: startsWith(as.character(call[[1]]), "scale_")
10: scale_y_continuous()
9: (function (data, mapping, ..., rescale = FALSE) 
   {
       mapping <- mapping_color_to_fill(mapping)
       p <- ggplot(data, mapping) + scale_y_continuous()
       if (identical(rescale, TRUE)) {
           p <- p + stat_density(aes(y = after_stat(!!as.name("scaled")) * 
               diff(range(x, na.rm = TRUE)) + min(x, na.rm = TRUE)), 
               position = "identity", geom = "line", ...)
       }
       else {
           p <- p + geom_density(...)
       }
       p
   })(data = structure(list(species = structure(c(1L, 1L, 1L, 1L, 

{redacted}

   2L, 2L, 2L, 2L, 2L, 2L), levels = c("Concinna", "Heikert.", "Heptapot."
   ), class = "factor"), tars1 = c(191L, 

{redacted}

       74L, 86L, 92L, 78L, 66L, 55L, 84L, 86L, 68L, 86L, 89L, 88L
       )), class = "data.frame", row.names = c(NA, -74L)), mapping = structure(list(
       x = ~tars1), class = "uneval"))
8: do.call(original_fn, allParams)
7: fn(pm$data, plotObj$mapping)
6: getPlot(pm, i, j)
5: `[.ggmatrix`(pm, i, j)
4: pm[i, j]
3: ggmatrix_gtable(x, ...)
2: print.ggmatrix(x)
1: (function (x, ...) 
   UseMethod("print"))(x)