[R] Title with substitute and paste

Wolfgang Viechtbauer wviechtb at cyrus.psych.uiuc.edu
Mon Aug 2 22:00:07 CEST 2004


Hello All,

I am generating some plots where the title is generated with substitute
and paste. An example:

nval <- 20
plot(0,0)
title(substitute(paste("n = ", n), list(n = nval)))

But when compared to:

plot(0,0)
title("n = 20")

the title in the first plot looks slightly different (it is not in
bold). How can I get the two titles to look exactly the same?

Also, how can I generate the following plot:

plot(0,0)
title("Test\n n = 20")

with substitute and paste? I tried:

nval <- 20
plot(0,0)
title(substitute(paste("Test\n", "n = ", n), list(n = nval)))

but that doesn't produce the same result.

Thanks in advance for any suggestions!

-- 
Wolfgang Viechtbauer
Department of Psychology
University of Illinois, Urbana-Champaign




More information about the R-help mailing list