916Order and ggplot2

Set Levels by Value x$name <- factor(x$name, levels = x$name[order(x$val)])

Set Levels by Name, Reverse Name Vector, first Name on top df$name <- factor(df$name, levels = rev(df$name))

TODO:

  • Explain/Understand R Factors
  • Add Example Data
  • Add Example Graphics

Source: https://rstudio-pubs-static.s3.amazonaws.com/7433_4537ea5073dc4162950abb715f513469.html