Try, wrapping your substitutes()'s with an eval(), as in

title(eval(substitute(paste("n = ", n), list(n = nval))))

-roger

Wolfgang Viechtbauer wrote:
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!


______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to