Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use several equal signs in text(x,y,expression(...))

is there a solution to use more than one equals signs in a expression (which are not within brackets)? I'm currently doing it with " = ". But thats not so nice, since == and " = " look different on the plot.

Minimal sample:

plot(0:5,0:5, type="n")
saleprice <- 35
revenue <- 98000
text(1, 2, 
     bquote(paste(R(x[G]) == .(saleprice)%.%x[G], " = ", .(revenue))))

See the following image for the current status: sample image

I would like to use something like:

bquote(R(x[G]) == .(saleprice)%.%x[G] == .(revenue))

But it produces errors.

like image 744
user2451870 Avatar asked Jun 04 '13 13:06

user2451870


Video Answer


1 Answers

Use {} to put an invisible grouping around the first equality.

text(1, 2, bquote({R(x[G]) == .(saleprice)%.%x[G]} == .(revenue)))
like image 117
Matthew Plourde Avatar answered Oct 16 '22 11:10

Matthew Plourde