tags:

views:

138

answers:

2

I want to show a block ascii character in R █ (its ascii code is 219) How can I show it in terminal?

I am using RGui on WinXP

+2  A: 

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 Д.

mobrule
+2  A: 

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

> "\u258A"
[1] "▊"
Jyotirmoy Bhattacharya
that looks pretty good in Win as well. Looks like an open rectangle.
JD Long