Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

r bquote() - how to remove spaces around around sub-scripted expression

Tags:

r

I'm using bquote() for a data label and the syntax below mostly works but I have spaces around the subscripted expression - how do I exclude these spaces?

plot(1, 2, pch = 10)
text(1, 2, bquote(~ 'Z(' ~ u[2] ~ ') = 2.0% Ni'), cex = 5)
like image 814
Markm0705 Avatar asked Dec 05 '25 15:12

Markm0705


1 Answers

Instead of ~, change it to *

text(1, 2, bquote(~ 'Z('*u[2]*') = 2.0% Ni'), cex = 5)

Or can be made compact by

text(1, 2, bquote(Z(u[2])*'= 2.0% Ni'), cex = 5)
like image 68
akrun Avatar answered Dec 07 '25 03:12

akrun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!