I have the following chart that I've created with a geom_col with position = "dodge":
What I'm trying to get is to have the "Garbage Time (Positive)" to appear the furthest left, "Positive" to be next, so on and so forth. I got the legend into the order that I want, but can't figure out a way to have that order reflected on the chart itself. For reference, here's the existing code for the chart:
ggplot() +
geom_col(data = all_stats_total, aes(x = rusher_position, y = fpts_pp, fill = game_script),
position = "dodge") +
scale_fill_discrete(limits = c("positive_garbage", "positive", "neutral", "negative", "negative_garbage"), labels = c("Garbage Time (Positive)", "Positive", "Neutral", "Negative", "Garbage Time (Negative)")) +
labs(y = "Fantasy Points Per Play",
title = "Passing-related positions (QB, WR, TE) perform more favorably in\npositive game scripts than negative game sripts. The impact on running\nbacks, by game script, is negligible.",
caption = "Figure: @SamHoppen | Data: @nflfastR",
fill = "Game Script")+
theme(axis.title.x = element_blank())
Any suggestions on how to make this happen?
Edit: Here's a sample of the data.
rusher_position game_script fpts_pp
QB negative 0.2725492
QB neutral 0.3949173
QB positive 0.6983354
QB negative_garbage 0.2456543
QB positive_garbage 0.9324257
RB negative 0.6726941
RB neutral 0.6541099
RB positive 0.8742239
RB negative_garbage 0.2456543
RB positive_garbage 0.9324254