Get rid of auto spacing using bquote in r

I am trying to designate the axis of the graph in r using the bquote function. The target string includes the greek mu character and the variable.

This leads to spaces in any part of mu:

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

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

I tried to use the expressions paste and paste0, but none of them allows you to use both the Greek character and the variable.

+4
source share
1 answer

If you want to get rid of the place on either side of mu

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

If you need a seat on the right

plot(1, xlab=bquote("Lake NO3 ("*mu~ "mol/L): " ~.(i) ))
+8
source

All Articles