Basically I wish to mitigate the amount of re-coding I have to do when creating new plots by only changing the reference to the "xvar" object below...
xvar<-"n_Age"
ggplot(data=dat4,aes(x=n_Age,y=Count))+
geom_smooth()+
labs(x=xvar, y="Count")
This code works ok in the "labs" part of the statement (as it is referencing text) however in the "aes" component I need to re-specify n_Age. Can I not just use some syntax that removes the quotation marks from the xvar object, to actually reference the object?
Thanks, Daniel.