Each column with qualitative data in an R dataframe has a "levels" attribute. This is a list of unique values in the column and it is what ggplot uses to determine the order of how things appear in your plots. By default, ggplot will order things alphabetically.
In order to override the default behavior, you need to override the "levels" attribute for the column you're interested in applying some custom order to. Here is some example code on how you may achieve that:
df$MAKE = factor(df$MAKE, levels = c("Honda", "Chevy", "Toyota"))
The factor()
method will convert the column to a factor (in case it isn't already) and you can set the levels attribute in there as well.
Run a line of code similar to the above prior to running the ggplot()
method and you should find that your ggplot output will order the values in this column in the way you dictated.