Show ASCII character

I want to show the ASCII character block █ (its ASCII code is 219),

How can I show it in the terminal?

I am using RGui on WinXP

+4
source share
3 answers

You can use backslash to avoid other non-printable characters:

print("\245") 

displays the yen symbol ( ¥ ) on my gui. 245 is in octal format, so the above expression prints ASCII (or some kind of encoding graphical interface) character 165.

219 is 333 in octal, but

 print("\333") 

displays the Û character on my gui.


R gui also supports several (but by no means all) Unicode characters:

 cyrillic_d <- "\u0414" print(cyrillic_d) 

displays D.

+5
source

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

 > "\u258A" [1] "▊" 
+4
source

This works on Windows.

 > "\u2588" [1] "█" 
+1
source

Source: https://habr.com/ru/post/1300120/


All Articles