I have an instance where I need to include Greek letters on a plot title that is multiple lines.
?
I've searched the forums for an approach to do this, but most of the previous posts and replies seem to just address instances of single line examples and problems:, e.g.
?
https://stat.ethz.ch/pipermail/r-help/1999-October/005096.html
?
I tried implementing those suggestions, e.g. "expression(paste(...))", but that seemed to remove all the line split formating, i.e. "\n".
?
In the example code below I would like the sigma to be the lower case Greek symbol for sigma.? Actually I would like the x and y to be subscripts of the lower case Greek symbol, but I suppose that is the next step.? I guess the key is that I would like to maintain the multiple line title while having the Greek letters.?
?
Thanks again for any feedback. and insights.
?
?
?
number_vals<-100
x<-rnorm(number_vals)
y<-rnorm(number_vals)
plot(1, 1,
???? xlim= c(min(x), max(x)),
???? ylim= c(min(y), max(y)), col=0)
points(x, y)
the_expression<-paste("Plotting y vs. x",
????????????????????? "\n sigma x = ", format(sd(x), digits=4, scientific=F),
????????????????????? "\n sigma y = ", format(sd(y), digits=4, scientific=F),? sep="")
?????????????????????
title(the_expression)
grid()
?
?
?
Oh yeah...