Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of auto spacing using bquote in r

I am attempting to label a plot axis in r using the bquote function. The desired string includes the greek mu character and a variable.

This results in spaces in either side of the mu:

xlab = bquote("Lake NO3 (" ~ mu ~ "mol/L): " ~ .(i))

How can I get rid of the spaces next to mu?

I tried using paste and paste0 expressions, but neither of these allow both a greek character and a variable.

like image 522
viridius Avatar asked Oct 17 '14 18:10

viridius


1 Answers

If you want to get rid off space on either side of mu

i <- 25
plot(1, xlab=bquote("Lake NO3 ("*mu*"mol/L): " ~.(i) ))

If you need space on the right

plot(1, xlab=bquote("Lake NO3 ("*mu~ "mol/L): " ~.(i) ))
like image 178
akrun Avatar answered Oct 09 '22 21:10

akrun