On 11/22/13 18:47, William Dunlap wrote:
a <- 2; b <- 3; xyplot(1:10 ~ a*(1:10), sub = c(bquote(a == .(a) ~ b==.(b))))

the subtitle contains three copies of the "a = 2  b = 3" phrase.
Why does it do that?  How do I tell it to give me only one copy?
To avoid it don't wrap bquote() with c().  The following does what you asked 
for:
     a <- 2; b <- 3; xyplot(1:10 ~ a*(1:10), sub = bquote(a == .(a) ~ b==.(b)))

Not for me it doesn't. Without the c() wrapper, I get no subtitle at all. Your recipe seems to work with base graphics and plot() but not with lattice and xyplot(). Also the c() wrapper
seems to have no impact when used with plot().

Moreover I am mystified by the impact of the c() wrapper when used with xyplot().

The result returned by bquote() has class "call". The result returned by c(bquote(...)) is a list, of length 1, whose sole entry is of class "call" and is, as one might expect, equal to the
result returned by bquote().

But why should passing this length-1 list as the value for "sub" cause a triplication of the
subtitle?

    cheers,

    Rolf

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to