Re: [R] plotmath: paste string and expression [from a vector of expressions]

2011-06-02 Thread David Winsemius
On Jun 2, 2011, at 5:07 PM, Marius Hofert wrote: Dear Dennis, Dear Uwe, Dear David, many thanks for helping. Dennis and David, your solutions seemed perfectly fine, but when I applied it to my original problem, it did not show a title. Below is a (longer) minimal example (the first part

Re: [R] plotmath: paste string and expression [from a vector of expressions]

2011-06-02 Thread Marius Hofert
Dear Dennis, Dear Uwe, Dear David, many thanks for helping. Dennis and David, your solutions seemed perfectly fine, but when I applied it to my original problem, it did not show a title. Below is a (longer) minimal example (the first part is from the help page of bbmle). Is this a bug in bbmle?

Re: [R] plotmath: paste string and expression [from a vector of expressions]

2011-06-02 Thread David Winsemius
On Jun 2, 2011, at 4:19 PM, Marius Hofert wrote: Dear Uwe, thanks for your help. Actually, I first thought about writing your solution in the email in order to make clear that it is not the solution I'm looking for :-) My goal is to work with the vector "vars" of expressions. The example

Re: [R] plotmath: paste string and expression [from a vector of expressions]

2011-06-02 Thread Dennis Murphy
Hi: This seems to work: vars2 <- c(quote(alpha), quote(beta)) # returns a list of mode call plot(0, 0, main = bquote(bold('Foo '~.(vars2[[2]] Expressions are only evaluated once, which means that inner expressions are not evaluated. You need a call object rather than an expression inside o

Re: [R] plotmath: paste string and expression [from a vector of expressions]

2011-06-02 Thread Marius Hofert
Dear Uwe, thanks for your help. Actually, I first thought about writing your solution in the email in order to make clear that it is not the solution I'm looking for :-) My goal is to work with the vector "vars" of expressions. The example is only a minimal example and for that your solution is

Re: [R] plotmath: paste string and expression [from a vector of expressions]

2011-06-02 Thread Uwe Ligges
On 02.06.2011 20:43, Marius Hofert wrote: Dear all, I have a vector of expressions and would like to "paste" some string to it before using it in a plot: vars<- vector("expression", 2) vars[1]<- expression(alpha) vars[2]<- expression(beta) plot(0, 0, main=substitute(bold("Foo" ~~ VAR), list(

[R] plotmath: paste string and expression [from a vector of expressions]

2011-06-02 Thread Marius Hofert
Dear all, I have a vector of expressions and would like to "paste" some string to it before using it in a plot: vars <- vector("expression", 2) vars[1] <- expression(alpha) vars[2] <- expression(beta) plot(0, 0, main=substitute(bold("Foo" ~~ VAR), list(VAR=vars[2]) )) Although I tried hard, I j