MatthieuBizien
MatthieuBizien

Reputation: 1725

How to print a number as exponent in R

Figures can be displayed as exponent in unicode, like ¹. How can I use that to convert an arbitrary number to a string with exponent characters, and print that with R?

I can print figures 1 and 2 using http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts but the other figures and minus doesn't work.

FWIW, I use Rstudio on Windows.

Upvotes: 0

Views: 1727

Answers (1)

Daniel Coelho
Daniel Coelho

Reputation: 456

As you pointed out, unicode has support for all digits in a superscript form, so it should not be a problem if you can print/render UTF-8 characters. The problem is that the font you will use to display the string must support those characters and I guess most of them do not. If you are printing to a console, check out what font it uses and check if that font supports the characters you want to print.

Upvotes: 1

Related Questions