Mathematical expressions for facets used to work just right when using something like labeller=as_labeller(old=expression(paste("Concentration (ng g"^"-1",")"))
. Now, I had to do something different to get the same results. There are some old posts 1,2 saying that in new versions some options no longer work so I want to know if that is the case here or there is something wrong with my system.
data(environmental) #lattice package
environmental_long<-environmental%>%
dplyr::mutate(day=seq(1,length(environmental$ozone),by = 1))%>%
tidyr::gather(key = "all_variables_name",value="values_variable",1:4)
environmental_long$names<-plyr::revalue(environmental_long$all_variables_name,c("ozone"="hat(x)~ozone~concentration(ppb)~'\u2030'"))
ggplot(environmental_long,aes(x=day,y=values_variable,colour=all_variables_name))+
geom_point()+
geom_smooth()+
facet_wrap(names~.,scales = "free_y", strip.position = "left", #switch = "y" for facet_wrap
labeller = label_parsed
)+
theme_bw()+
theme(legend.position = "none",
strip.placement = "outside",
axis.title.y = element_blank(),
strip.background = element_rect(fill="white"))