Unicode Symbols at the R Prompt

A small subset of Unicode symbols, that are useful when building command line applications. They fall back to alternatives on terminals that do not support Unicode. Many symbols were taken from the 'figures' 'npm' package (see < https://github.com/sindresorhus/figures>).


Linux Build Status Windows Build status CRAN RStudio mirror downloads

Inspired by (and mostly copied from) the figures JavaScript project.

Install

install.packages("devtools")
devtools::install_github("gaborcsardi/clisymbols")

Usage

library(clisymbols)
cat(symbol$tick, "All good\n")
#> ✔ All good
cat(symbol$cross, "Problem\n")
#> ✖ Problem

Here is a list of all symbols, with their names:

for (i in seq_along(symbol)) {
  cat(symbol[[i]], "\t", names(symbol)[i], "\n", sep = "")
}
#> ✔	tick
#> ✖	cross
#> ★	star
#> ▇	square
#> ◻	square_small
#> ◼	square_small_filled
#> ◯	circle
#> ◉	circle_filled
#> ◌	circle_dotted
#> ◎	circle_double
#> ⓞ	circle_circle
#> ⓧ	circle_cross
#> Ⓘ	circle_pipe
#> ?⃝	circle_question_mark
#> ●	bullet
#> ․	dot
#> ─	line
#> ═	double_line
#> …	ellipsis
#> ❯	pointer
#> ℹ	info
#> ⚠	warning
#> ☰	menu
#> ☺	smiley
#> ෴	mustache
#> ♥	heart
#> ↑	arrow_up
#> ↓	arrow_down
#> ←	arrow_left
#> →	arrow_right
#> ◉	radio_on
#> ◯	radio_off
#> ☒	checkbox_on
#> ☐	checkbox_off
#> ⓧ	checkbox_circle_on
#> Ⓘ	checkbox_circle_off
#> ❓	fancy_question_mark
#> ≠	neq
#> ≥	geq
#> ≤	leq
#> ▔	upper_block_1
#> ▀	upper_block_4
#> ▁	lower_block_1
#> ▂	lower_block_2
#> ▃	lower_block_3
#> ▄	lower_block_4
#> ▅	lower_block_5
#> ▆	lower_block_6
#> ▇	lower_block_7
#> █	lower_block_8
#> █	full_block

Fallback symbols

Some terminals do not support (all) Unicode characters, and on these reasonable ASCII substitutes are used:

#> √   tick
#> x   cross
#> *   star
#> █   square
#> [ ] square_small
#> [█] square_small_filled
#> ( ) circle
#> (*) circle_filled
#> ( ) circle_dotted
#> (o) circle_double
#> (o) circle_circle
#> (x) circle_cross
#> (|) circle_pipe
#> (?) circle_question_mark
#> *   bullet
#> .   dot
#> ─   line
#> =   double_line
#> ... ellipsis
#> >   pointer
#> i   info
#> ‼   warning
#> ≡   menu
#> ☺   smiley
#> ┌─┐ mustache
#> ♥   heart
#> ^   arrow_up
#> v   arrow_down
#> <   arrow_left
#> >   arrow_right
#> (*) radio_on
#> ( ) radio_off
#> [x] checkbox_on
#> [ ] checkbox_off
#> (x) checkbox_circle_on
#> ( ) checkbox_circle_off
#> (?) fancy_question_mark
#> !=  neq
#> >=  geq
#> <=  leq
#> ^   upper_block_1
#> ^   upper_block_4
#> .   lower_block_1
#> _   lower_block_2
#> _   lower_block_3
#> =   lower_block_4
#> =   lower_block_5
#> *   lower_block_6
#> █   lower_block_7
#> █   lower_block_8
#> █   full_block

License

MIT © Gabor Csardi and Sindre Sorhus

News

1.2.0

  • New symbol: double_line: ═

  • New block symbols: upper_block_1: ▔, upper_block_4: ▀, lower_block_1: ▁, etc. lower_block_8: █ (lower_block_8 is also known as full_block.)

  • Better detection of UTF-8 support: use the official l10n_info() function

1.1.0

Three more symbols: neq: ≠, geq: ≥, leq: ≤

1.0.0

First released version.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("clisymbols")

1.2.0 by Gábor Csárdi, 2 years ago


https://github.com/gaborcsardi/clisymbols


Report a bug at https://github.com/gaborcsardi/clisymbols/issues


Browse source code at https://github.com/cran/clisymbols


Authors: Gábor Csárdi [aut, cre] , Sindre Sorhus [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Suggests testthat


Imported by OptimClassifier, RFishBC, TeXCheckR, available, blorr, classyfireR, exampletestr, foghorn, goodpractice, olsrr, piggyback, prodigenr, tracer, usethis.

Suggested by vegawidget.


See at CRAN