Hello. So here is a very short example for the code:
mtcars %>% ggplot(aes(x=wt,y=mpg,group=1))+
geom_point()+geom_line()+
theme(panel.grid = element_rect(fill = "grey"),
axis.text = element_text(face = "bold"))
Error in `**merge_element()**`:
! Only elements of the same class can be merged
Run `rlang::last_error()` to see where the error occurred.
This is such an annoying error, and it really seems like something R folks should take care of. This error is prevented by adding a simple theme_bw() (or alike) argument, but it then cancels the text argument within theme()
Great. Thank you, I don't know why checking the cheatsheet or help file didn't occur to me. Maybe because it didn't throw an error all the time so I thought I wasn't doing anything wrong.