A convenience function that returns a theme element to control legend position in ggplot2 plots.
Examples
if (FALSE) { # \dontrun{
library(ggplot2)
# Legend on the right (default ggplot behavior)
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
geom_point() +
legend_position("right")
# Remove legend
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
geom_point() +
legend_position("none")
} # }