[R] Plot title with numeric variables

Gabor Grothendieck ggrothendieck at gmail.com
Wed Nov 15 17:30:16 CET 2006


Or create a function (reworking Thomas' code):

pretitle <- function(n) bquote(bold("Figure"~.(N)~"Plot"~C[max]~"vs. CrCl"))
plot(0, main = pretitle(1))



On 11/15/06, Thomas Lumley <tlumley at u.washington.edu> wrote:
> 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
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list