I'm getting an error using facet_wrap in ggplot2: "Error: predicate
must be a closure or function pointer"
I do not have the problem when I use facet_grid.
This appears to be the same issue described in this post (I would have posted this as a comment, but don't have enough cred to do so. Also, the response seemed to attribute the issue to using the development version of ggplot. I'm using the tidyverse version installed from CRAN): ggplot2 facet_wrap Error: predicate must be a closure
Anybody else experiencing this? Thanks!
# Install from CRAN
# install.packages("tidyverse")
library(tidyverse)
mtcars %>%
ggplot(aes(mpg,wt)) +
geom_point() +
facet_wrap(~cyl)
# This fails with message:
# Error: `predicate` must be a closure or function pointer
mtcars %>%
ggplot(aes(mpg,wt)) +
geom_point() +
facet_grid(cyl~carb)
# This works
# Session info
# R version 3.4.4 (2018-03-15)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows >= 8 x64 (build 9200)
#
# Matrix products: default
#
# locale:
# [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
# [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
# [5] LC_TIME=English_United States.1252
#
# attached base packages:
# [1] stats graphics grDevices utils datasets methods base
#
# other attached packages:
# [1] forcats_0.3.0 stringr_1.3.0 dplyr_0.7.4 purrr_0.2.4
# [5] readr_1.1.1 tidyr_0.8.0 tibble_1.4.2 ggplot2_2.2.1.9000
# [9] tidyverse_1.2.1
#