Switching columns within a geom_col() plot in R

66 Views Asked by At

I am attempting to switch the plotted bars so the first column is for Budgeted and the second column in for Actual. Any help is much appreciated.

Picture

This is my code.

library(tidyverse)
library(ggplot2)
library(dplyr)
library(scales)

Mississppi <-as.data.frame(R_test_8)
head(Mississppi)


ggplot() + geom_col(data = Mississppi, aes( x = Ship, y = Mandays , fill = Type), position = "dodge") +  geom_point() +
 scale_y_continuous(labels = label_number (suffix = " K", scale = 1e-3), limits = c(0, 400000), breaks = seq(0, 400000, by = 50000)) + geom_hline(yintercept = 200000, color = "#7c7d81", linetype = 2) + scale_fill_manual(values = c("#6b9bb1", "#102031")) +  geom_point() +
  theme_classic() + theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + ggtitle("Days of Labor (Thousands)")

0

There are 0 best solutions below