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
Below is a simple example in which I prepare two scatter plots using the mtcars data set. var contains the name of the variable in mtcars which should be plotted on the y axis. Notice when I change the value of var the plot is automatically updated without any formal assignment. Does this happen on your end as well? Is this normal behaviour? Many thanks.
library(ggplot2)
data(mtcars)
var <- "cyl"
g <- ggplot(mtcars, aes(get(var), mpg)) + geom_point()
g
# change the value of varvar<-"wt"# look at the original (!) plotg