How do I change the theme using a variable?
library(ggplot2)
ggplot(iris,aes(Sepal.Length,Petal.Width))+
geom_point()
I could do
ggplot(iris,aes(Sepal.Length,Petal.Width))+
geom_point()+
theme_bw()
instead what if my theme is defined in a variable,
var1 <- "theme_bw"
var2 <- "theme_grey"
Can I use this to set the theme?
ggplot() + get("theme_bw")()