Skip to content
Prev 317001 / 398506 Next

Adding Latex to text

On Feb 6, 2013, at 4:53 PM, Rolf Turner wrote:

            
Definitely ...  he _will_ want to look at ?plotmath, but there is a lot on that page and teh parts that explain the parsing of expressions were not at all clear to me in hte beginning. Some of us find it's better to learn from examples and since he has already constructed a perfectly fine one hten here's my effort at making it "work":

library(UsingR)
BagA = c(rep(10,6),rep(20,5), rep(30,4),rep(40,3),rep(50,2),60,70)
BagA
BagB = c(10, 20,rep(30,2),rep(40,3),rep(50,4),rep(60,5),rep(70,6))
BagB

par(mfrow = c(2, 1))
DOTplot(BagA)
abline(v=60,lwd=2,lty=2,col="red")
text(65,3, expression(alpha*"-->"), col=2)
abline(v=50, lwd=2, lty=2, col="blue")
text(57,5, "p-value------->", col="blue")
DOTplot(BagB)
abline(v=60,lwd=2,lty=2,col="red")
text(55,3, expression("<--"*beta), col=2)
par(mfrow = c(1, 1))
David Winsemius
Alameda, CA, USA