[R] Plot title with numeric variables

Thomas Lumley tlumley at u.washington.edu
Wed Nov 15 16:10:32 CET 2006


On Tue, 14 Nov 2006, RMan54 wrote:

>
> This works for the original posted question:
>
> n<-5
> title <- bquote(bold(paste("Figure ", .(n), ": Plot ", C[max], " versus
> CrCl")))
> plot(1, main=title)
>
> However, my problem is that I want to define the text before the value of n
> is known.
> The idea is that the title is defined ahead, passed to a function that makes
> many plots, and n is incremented for each plot.


  pretitle <- quote(bold("Figure"~.(N)~"Plot"~C[max]~"versus CrCl"))

## later on inside a function
  N<-1
  title<-do.call(bquote,list(pretitle))

 	-thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



More information about the R-help mailing list