How can I change the position of the subtitle in r "base" plot. Is there a special argument? I want to dynamically have the subtitle left or right aligned.
data
plot(mtcars$mpg,mtcars$qsec,xlab="",sub="I WANT TO\nBE RIGHT\nALIGNED")
plot data with desired output in red
EDIT
plottR <- function(...) {
plot(...)
}
plottR(mtcars$mpg, mtcars$qsec, ylab="Y Must Center", xlab="X Must Center", main="Must center", sub="Must right-align",adj=1)
Can I input something to plottR so it only aligns the subtitle?
EDIT2
I just found out. I can evaluate the title()
inside plot.
plottR(mtcars$mpg, mtcars$qsec, ylab="Y Must Center", xlab="X Must Center", main = "Must Center", title(sub ="Hey Only\nim right\ncool huh?",adj=1))