[R] Plotmath with values?

Sarah Goslee sarah.goslee at gmail.com
Wed Dec 31 21:51:16 CET 2008


Sorry, apparently I can't type. Gabor's example and my test case
should be identical, and weren't in my original email (now fixed).

Sarah

On Wed, Dec 31, 2008 at 1:42 PM, Sarah Goslee <sarah.goslee at gmail.com> wrote:
> Hi all,
>
> I hadn't used bquote before, so I gave this a try, only to encounter some odd
> behavior.
>
> R 2.8.0 on Fedora Core 8 (no RPM for 2.8.1 yet)
> "vanilla" session with no packages loaded (same behavior with my usual
> set of packages).
>
> On Wed, Dec 31, 2008 at 12:30 PM, Gabor Grothendieck
> <ggrothendieck at gmail.com> wrote:
>> Try:
>>
>> aa <- 22
>> plot(1, main = bquote(a == .(aa)))
>>
>
> R --vanilla
>
> aa <- 22
> x11()
> plot(1, main=paste("a == ", aa)) # plot with title
> plot(1, main = bquote(a == .(aa))) # plot _without_ title
> plot(1, main=paste("a == ", aa)) # plot _without_ title - ???
>
> plot(1, main="abc") # plot _without_ title - ???
> dev.off()
>
> # after trying bquote(), no plots have titles until I close
> # the device and open a new one.
>
> x11()
> plot(1, main="abc") # plot with title
> dev.off()
>
> The png device does not have a plot with a title. postscript() works as
> expected.
>
> What am I missing?



-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list