0

I'd like to get the following plot:

plot(rnorm(10),main=expression(lambda==10))

greek

However, the number "10" in the title would come from a variable to be evaluated, say foo:

foo <- 10

I have looked at this question and this question, but I'm not getting anywhere.

Community
  • 1
  • 1
Stephan Kolassa
  • 7,953
  • 2
  • 28
  • 48
  • 2
    This works for me: `foo <- 10; plot(rnorm(10), main = bquote(lambda==.(foo)))` – zx8754 Sep 22 '15 at 10:20
  • @zx8754: cool, thanks! I did try `bquote`, but only wrapped it around `foo`, then `paste`d it together with `lambda==`... If you'll post this as an answer, I'll happily upvote and accept. – Stephan Kolassa Sep 22 '15 at 10:27
  • Happy it worked. In future, note that it is a good practice to show what you have tried in the post. – zx8754 Sep 22 '15 at 10:32

0 Answers0