You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running ggplot() with a legend and using theme(legend.position = .) to change the legend direction, an invalid argument causes an unclear error. I also feel like abbreviations should be allowed for this argument since it only accepts two strings.
library(ggplot2)
ggplot(mpg, aes(x = cty, fill = drv)) +
geom_histogram() +
theme(legend.direction = "v")
## Error in if (!g$title.position %in% c("top", "bottom", "left", "right")) { :
## argument is of length zero