This would need to be custom-tailored to make it look better, but this will give you a starting point
library(tidyverse)
library(tibbletime)
library(lubridate)
library(scales)
dt <- tibble( `Shipment_ID` = c("S00023613", "S00023614", "S00023615", "S00023616", "S00023617", "S00023618", "S00023619", "S00023622", "S00023623", "S00023624", "S00023625", "S00023626", "S00023627", "S00023628", "S00023629", "S00023630", "S00023631", "S00023632", "S00023633", "S00023634", "S00023635"),
`Job_Recog_Date` = c("2018-04-01", "2018-08-01", "2018-10-01", "2018-02-01", "2018-04-01", "2019-05-16", "2019-04-02", "2019-03-21", "2019-03-26", "2019-03-30", "2019-07-12", "2019-08-07", "2019-03-28", "2019-04-09", "2020-03-28", "2020-04-03", "2020-03-16", "2020-11-29", NA,"2020-12-31", "2020-04-19"),
`Total_Income` = c(2490.00, 2490.00, 2490.00, 2490.00, 2490.00, 4381.10, 4076.40, 3000.00, 4939.72, 3300.00, 4476.71, 6970.53, 1350.00, 3751.42, 1845.00, 3210.00, 1128.05, 1382.00, 0.00, 130.00, 549.06),
`Total_Expense` = c(-2195.45, -2239.64, -2139.64, -2139.64, -2239.64, -4020.97, -3658.90, -2597.32, -4881.32, -3078.94, -3823.71, -5574.53, -1221.00, -3929.92, -1724.00, -3064.00, -735.44, -1267.00, 0.00, 8.00, -337.85),
`Job_Profit` = c(294.55, 250.36, 350.36, 350.36, 250.36, 360.13, 417.50, 402.68, 58.40, 221.06, 653.00, 1396.00, 129.00, -178.50, 121.00, 146.00, 392.61, 115.00, 0.00, 138.00, 211.21)
)
dt_monthly <- dt %>%
drop_na(Job_Recog_Date) %>%
mutate(Job_Recog_Date = as.Date(Job_Recog_Date),
Total_Expense = -Total_Expense) %>%
arrange(Job_Recog_Date) %>%
as_tbl_time(index = Job_Recog_Date) %>%
collapse_by("1 month", side = "start", clean = TRUE) %>%
group_by(Job_Recog_Date) %>%
summarise_if(is.numeric, sum, na.rm = TRUE) %>%
mutate(month = as.factor(month(Job_Recog_Date,
label = TRUE,
abbr = FALSE))) %>%
ungroup()
dt_monthly %>%
ggplot(aes(x = month)) +
geom_col(aes(y = Total_Income, fill = month), show.legend = FALSE) +
geom_text(aes(y = Total_Income,
label = number(Total_Income,
prefix = "$ ",
accuracy = 1,
decimal.mark = ".",
big.mark = ",")),
vjust = -0.2,
family = "Cloud Calligraphy", size=5) +
geom_col(aes(y = Total_Expense),
width = 0.5) +
geom_text(aes(y = Total_Expense,
label = number(Total_Expense,
prefix = "$ ",
accuracy = 1,
decimal.mark = ".",
big.mark = ",")),
vjust = -0.2,
size = 4,
family = "Cloud Calligraphy") +
facet_grid(year(Job_Recog_Date)~.) +
scale_y_continuous(expand = c(0.1,0)) +
scale_fill_brewer(palette = "Set3") +
labs(
title = "Monthly Total Expenses & Income by Year",
y = "$ in Millions",
x = "Month"
) +
theme(axis.text.x = element_text(angle = 30, hjust = 1, vjust = 1)) +
NULL

dt_monthly %>%
select(Job_Recog_Date, Total_Income, Total_Expense) %>%
gather(Total, amount, -Job_Recog_Date) %>%
ggplot(aes(x = Job_Recog_Date, y = amount, fill = factor(Total, levels = c("Total_Income", "Total_Expense")))) +
geom_area(position = "identity", alpha=0.9) +
scale_x_date(date_breaks = "1 month",
labels = label_date_short(),
expand = c(0.005,0.005)) +
scale_fill_manual(values = c("#00BFC4", "#F8766D"),
labels = c("Total Income", "Total Expense")) +
labs(
title = "Monthly Total Expenses & Income by Year",
y = "$ in Millions",
x = "Month",
fill = ""
) +
theme(legend.position = "bottom",
axis.text.x = element_text(angle = 30, hjust = 1, vjust = 1)) +
NULL
