I need to use a heading that includes Mean +- SD. So far, I can only get this:
"Mean +- SD or N (%)"
[1] "Mean +- SD or N (%)"
How can I directly use the "+-" symbol? You know the one character, not two.
Just for the future, how about other symbols, like Greek letter and so on?
I'm assuming you're going to be putting these on a plot. If that's the case, then be sure to check out the ?plotmath
help page. In your example, you could use
plot(1,1,main=expression(paste("Mean", phantom(.)%+-%phantom(.), "SD or N (%)")))
If you're just taking about plain text output, that depends on the encoding you have set up on your GUI. And how you type that in would depend on your operating system. You can include the unicode escape code in a string
x<-"Mean \u00b1 SD or N (%)"
Encoding(x)<-"UTF-8"
x
#[1] "Mean ± SD or N (%)"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With