开发者

Show an ASCII character

I want to show a block ASCII character █ (it's ASCII code is 219),

How can I show i开发者_StackOverflowt in terminal?

I am using RGui on WinXP


You can use backslash to escape otherwise unprintable characters:

print("\245")

displays the Yen character (¥) on my gui. The 245 is in octal format, so the above expression is printing out ASCII (or whatever encoding the GUI is using) character 165.

219 is 333 in octal, but

print("\333")

prints out the Û character on my gui.


A few (but by no means all) unicode characters are also supported on the R gui:

cyrillic_d <- "\u0414"
print(cyrillic_d)

outputs Д.


Following mobrule, the following works on R running in a UTF-8 locale on Linux:

> "\u258A"
[1] "▊"


This works on Windows

> "\u2588"
[1] "█"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜