Superscripts in R

橙三吉。 提交于 2020-01-04 00:10:08

问题


I am trying to output a .xlsx file with a column name that has superscripted text.

for example like:

holdings=data.frame("x"=rep(12,4), "y"=rep(14, 4))
colnames(holdings)=c("Name","RankTM")

but with the "TM" superscripted.

Anyone able to help?


回答1:


I suggest not doing that. Column names should be plain text but you may have a good reason for doing this.

Find the unicode for TM (2122) and escape it like so \u\+###. eg: colnames(holdings) = c("Name","Rank\u2122")



来源:https://stackoverflow.com/questions/48877641/superscripts-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!