teunbrand / ggh4x

ggplot extension: options for tailored facets, multiple colourscales and miscellaneous
https://teunbrand.github.io/ggh4x/
Other
534 stars 32 forks source link

Error in check_object(cols, is_quosures, "a {.fn vars} specification" #157

Closed lulu5049 closed 2 months ago

lulu5049 commented 2 months ago

Thanks for the great package.

I encounter the following problem when I use the facet_grid2 function (using the demo examples ).

> p <- ggplot(mpg, aes(displ, hwy, colour = as.factor(cyl))) + geom_point() +
+     labs(x = "Engine displacement", y = "Highway miles per gallon") +
+     guides(colour = "none")
> p + facet_grid2(vars(year), vars(drv), axes = "all", remove_labels = "y")
Error in check_object(cols, is_quosures, "a {.fn vars} specification",  : 
  could not find function "check_object"
> traceback()
3: .int$grid_as_facets_list(rows, cols)
2: new_grid_facets(rows, cols, scales, space, axes, remove_labels, 
       independent, shrink, labeller, as.table, switch, drop, margins, 
       render_empty, strip, super = FacetGrid2)
1: facet_grid2(vars(year), vars(drv), axes = "all", remove_labels = "y")

image

Is it a function in other packages?

teunbrand commented 2 months ago

The example works fine on my end. What versions of ggh4x and ggplot2 are you using?

lulu5049 commented 2 months ago

ggplot2: version 3.5.0, ggh4x: version 0.2.8.9000

The code now works in my computer. I cannot reproduce the error. Maybe because I restart my Rstudio.

teunbrand commented 2 months ago

Might have been a desync between ggplot2 and ggh4x but I'm glad it's resolved now