Skip to content
Prev 261734 / 398502 Next

plotmath: paste string and expression [from a vectorof expressions]

Use VAR=vars[[2]] (double brackets) there.  You can see the
difference if you look at the output of your call to substitute.
[[ gives you an element of the expression and [ gives you
an expression containing an element:

  > substitute(bold("Foo" ~~ VAR), list(VAR=vars[[2]]) )
  bold("Foo" ~ ~beta)
  > substitute(bold("Foo" ~~ VAR), list(VAR=vars[2]) )
  bold("Foo" ~ ~expression(beta))

The same holds for the bquote() solution that David W. suggested.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com