so suppose i have data set:
date order_sum
2015-01-01 800
2016-08-19 900
2019-04-16 1200
2020-10-28 850
here's my to-month conversion: sales$month <- month(sales$date)
here's my minimum to be used in x-axis: min <- ymd("2020-11-01")
here's my base plot specifying my df: baseplot <- ggplot(sales, aes(month, order_sum))
i'm trying to make a basic graph of date vs sum of order_sum
for that month and display date in x-axis as 11-2020
.
scale_x_date(limits = c(min, now), breaks = "1 month", labels = date_format("%m-%Y")) +
scale_y_continuous(labels = function(x) scales::dollar(x, suffix = 'M'), n.breaks = 3, expand = expansion(mult = c(0, 0.05))) +
labs(x = "Date", y = "Order Volume")
the error i get back on the text block is this:
Error in as.Date.default(e) : do not know how to convert 'e' to class “Date”
anyone know why? thanks in advance!