Closed
Description
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