Reputation: 1418
Assume you have an existing expression() in R, e.g.
myExpression <- expression(x^2)
and wish to add <= to it without completely redefining the expression. So I am looking for a command that looks something like
myExpression <- bquote(phantom()<=.(myExpression))
The above does not work properly, which you can easily verify using
plot(1,1, main=myExpression)
The result should be
expression(phantom()<=x^2))
Upvotes: 2
Views: 70
Reputation: 269491
Try this
myExpression <- expression(x^2)
plot(1, 1, main = bquote(phantom()<=.(myExpression[[1]])))
Upvotes: 4