2
DOLMin<-as.Date("2012-1-1")
DOLMax<-as.Date("2012-12-31")
title<-paste("Claims:",format.Date(DOLMin,"%b %Y"),"\u2264 DOL \u2264",format.Date(DOLMax,"%b %Y"))
plot(1:2,main=title)

The above code creates this meaningless plot enter image description here

My problem is that I cannot build a pdf of this plot because of the way I'm generating my less than or equal to symbols.

How do I recreate the same title using plotmath? Doing so will solve my pdf error issue which I describe here

Community
  • 1
  • 1
Ben
  • 20,038
  • 30
  • 112
  • 189
  • Well, read `?plotmath`. – Roland Jan 17 '14 at 22:45
  • 1
    @Roland I read ?plotmath and still could not figure out how to get my title the way I want it. Can you provide a working solution for my question or at least give me a suggestion other than read ?plotmath – Ben Jan 17 '14 at 23:00
  • 1
    Thanks. I figure if neither I nor joran can do it without a search of more than the help page you ought to get credit for a relatively difficult question. I consider myself a power user of plotmath but I was stuck. – IRTFM Jan 18 '14 at 00:49

1 Answers1

4

This was a little tricky:

a <- paste("Claims:",format.Date(DOLMin,"%b %Y"))
b <- format.Date(DOLMax,"%b %Y")
plot(1:2,main=bquote({.(a) <= DOL} <= .(b)))

I actually was not able to do this when I read your question. I figured it out by Googling and using the results from this SO question and then this one.

Community
  • 1
  • 1
joran
  • 169,992
  • 32
  • 429
  • 468