I have below data structure "x":
# A tibble: 18 x 4
mm mm_fct Legenda waarde
<date> <fct> <chr> <dbl>
1 2020-07-01 2020-07-01 Gas 0.906
2 2020-07-01 2020-07-01 Temp 17.3
3 2020-08-01 2020-08-01 Gas 0.935
This is plotted nicely by (x-axis needs factors(!)):
ggplot(x, aes(mm_fct, waarde, fill = Legenda)) +
geom_col(position = position_dodge2())
I like to have a date on the x-axis so add to scale_x_date() but then get an Error:
ggplot(x, aes(mm_fct, waarde, fill = Legenda)) +
geom_col(position = position_dodge2()) +
scale_x_date(x$mm)
Error: Invalid input: date_trans works with objects of class Date only
What ever I enter as arguments in scale_x_date().
Please help !