I have some data for which I want to get density plots. For each facet, I want to use personalized maths expression, but unfortunately, this doesn't display correctly using Tex function:
ggplot(data = x, aes(x=.data[[clinical_factor]], y=LBORRES,color=.data[[clinical_factor]]))+
geom_violin()+theme_bw()+
facet_wrap (~POPULATION, ncol=2, scales = "free_y",
labeller = labeller(POPULATION = as_labeller(latex2exp::TeX)))
head(x)
DISEASE LBORRES POPULATION OMIC_ID
1: SjS 273 Monocytes 32140214
2: SjS 0 LDGs 32140214
3: SjS 3 CD4$^+$CD8$^+$ T cells 32140214
4: SjS 8 Non classical monocytes 32140214
5: SjS 2490 Neutrophils 32140214
6: SjS 146 B Cells 32140214
And here's the output:
Do you have any idea how to deal with Math latex symbols with facet wrap?