ASCII: ASCII Characters

ASCIIR Documentation

ASCII Characters

Description

ASCII generates a character vector of the ASCII characters. If plot = TRUE, the resulting characters are plotted, before they are returned invisibly.

Usage

ASCII(extended = TRUE, cex = par("cex"), family = par("family"),
    mar = c(0, 2.1, 2.1, 0), plot = TRUE, warn.unused = TRUE)

Arguments

extended

logical. Should the extended ASCII character set be returned? Note that “Extended ASCII” does NOT mean that the ASCII standard has been updated to include more than 128 characters.

cex

A numerical value giving the amount by which text should be magnified relative to the default.

family

The name of a font family for drawing text. See par.

mar

A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot.

plot

logical. If TRUE (default), the ASCII characters are plotted, and the ASCII characters are returned invisibly. Otherwise, the ASCII characters are returned.

warn.unused

logical. If plot = FALSE and warn.unused = TRUE, a warning will be thrown when graphical parameters are passed to ASCII.

Details

The first 32 ASCII characters are control characters (as well as the 128-th, that is "\x7F" or "\177"), consisting of non-printable characters and whitespace characters, so they will likely plot as an empty box or nothing at all.

Characters "\x81", "\x8D", "\x8F", "\x90", and "\x9D" (or in octal notation as "\201", "\215", "\217", "\220", and "\235") are unused in extended ASCII, and will plot unusually. In an ISO8859-1 locale, they seem to plot empty. In a UTF-8 locale, they seem to plot as their bytes codes (that is <81>, <8D>, <8F>, <90>, and <9D>). In other locales, they may plot as question marks, or any other unusual behaviour.

Characters "\x20" and "\xA0" are space and non-breaking space, so they will plot empty.

Character "\xAD" is a soft hyphen. In an ISO8859-1 locale, it appears the same as a regular hyphen ("\x2D"). In a UTF-8 locale, it appears empty. Unknown behvaiour for other locales. This character may also plot differently depending on family.

Value

character vector, the ASCII character set. When extended, 255 characters, otherwise 127 characters (NUL character is not included since R does not allow nul character within strings).

if plot, returned invisibly.

Examples

ASCII()

ArcadeAntics/essentials documentation built on Nov. 7, 2024, 4:33 p.m.