I found a problem with label_bquote. I was trying to use an expression show the value of a parameter in the facet labels and I found that when I used as.table = FALSE the values of the rows were instead turned into integers. I am guessing this is because the values were first turned into factors and then faceted, but I am not sure.
Here is the code to reproduce the bug:
library(tidyverse)
expand_grid(a = c(0.15, 0.85),
b = c(0.001, 0.0025, 0.005),
x = rnorm(10),
y = rnorm(10)) %>%
ggplot(., aes(x,y)) +
geom_point() +
facet_grid(a ~ b,
as.table = F, # <- works when this is TRUE
labeller = label_bquote(rows = alpha==.(a),
cols = beta==.(b)))
I found a problem with label_bquote. I was trying to use an expression show the value of a parameter in the facet labels and I found that when I used
as.table = FALSEthe values of the rows were instead turned into integers. I am guessing this is because the values were first turned into factors and then faceted, but I am not sure.Here is the code to reproduce the bug: