简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM