Beeswarm from Reordering Categorical Variables

92 Views Asked by At

I am trying to make beeswarm and boxplot graphs of my data, but beeswarm is putting the categorical variables in alphabetical order when I would like them in order of treatment.

iMono <- beeswarm(iMono ~ Treatment, data=MyeloidLiver, ylab = "% Inflammatory",
         log = FALSE, pch=16, main = '% Inflammatory Monocytes v Treatment',
         col = rainbow(4), cex.axis = 1, cex = 1) +
  bxplot(iMono ~ Treatment, data=MyeloidLiver, add=TRUE)

I have tried using levels = c() and labels = c() but levels is not a graphical parameter for beeswarm and labels changes the labels without reordering the corresponding data.

0

There are 0 best solutions below