R Changing Order of Facets
As you only have two factor levels you can use forcats::fct_rev()
within your ggplot code (no need to load forcats
if you have tidyverse
already loaded).
library(forcats)
# replace last line of code with
facet_grid( ~ fct_rev(group), scale = "free")
dfx$group <- factor(dfx$group, levels = c("SLG","BA"))