cat doesn't work with "bquoted" arguments. At least not with the simple
cat(xxx, ccc).
 
Rene

  _____  

From: Jeffrey Robert Spies [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 14, 2006 1:58 PM
To: Rene Braeckman
Cc: r-help
Subject: Re: [R] Plot title with numeric variables


How about using the cat function to concatenate the constant string with the
dynamic string and then bold the result of that? 

-- 
Jeff Spies
 <http://www.nd.edu/~jspies/> http://www.nd.edu/~jspies/


On Nov 14, 2006, at 4:39 PM, Rene Braeckman wrote:


Thanks for your quick response. This works but the problem is that I can't
define the title ahead before N is defined or changed.

The idea is that the title is defined ahead, passed to a function that makes
many plots, and N is incremented for each plot.

One way to accomplish this would be to have the constant part of the title
defined ahead:

xxx <- bquote(bold("Plot"~C[max]~"versus CrCl"))


Bold is needed because the subscripted text "max" is too light (doesn't seem
to follow font changes) but I could leave it out if needed.

And then add this to the changing part at the time the plot is made (when
the value of N is correct).
The changing part is:

ccc <- bquote(("Figure"~.(N))


I just don't know how to concatenate both xxx and ccc to create the title.

Thanks again,
Rene

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 14, 2006 12:42 PM
To: [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Plot title with numeric variables

The key thing is the function bquote().

E.g.

> N <- 5
> xxx <- bquote(bold("Figure"~.(N)~"Plot"~C[max]~"versus CrCl"))
> plot(1:10,main=xxx)

(Not sure about the ``bold'' business, but R doesn't object.)

Or to take a simpler and clearer example:

> N <- 5
> plot(1:10,main=bquote("Figure"~.(N))


cheers,

Rolf Turner
[EMAIL PROTECTED]

______________________________________________
R-help@stat.math.ethz.ch 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.



        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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