map_text_chars: map_text_chars maps the characters of a text string into a...

Description Usage Arguments Details Value See Also

View source: R/text_fun.R

Description

map_text_chars parses text (from a text string x) into a table that contains a row for each character and x/y-coordinates corresponding to the character positions in x.

Usage

1
map_text_chars(x, flip_y = FALSE)

Arguments

x

The text string(s) to map (required). If length(x) > 1, elements are mapped to different lines (i.e., y-coordinates).

flip_y

Boolean: Should y-coordinates be flipped, so that the lowest line in the text file becomes y = 1, and the top line in the text file becomes y = n_lines? Default: flip_y = FALSE.

Details

map_text_chars creates a data frame with 3 variables: Each character's x- and y-coordinates (from top to bottom) and a variable char for the character at these coordinates.

Note that map_text_chars was originally a part of read_ascii, but has been separated to enable independent access to separate functionalities.

Note that map_text_chars is replaced by the simpler map_text_coord function.

Value

A data frame with 3 variables: Each character's x- and y-coordinates (from top to bottom) and a variable char for the character at this coordinate.

See Also

read_ascii for parsing text from file or user input; plot_chars for a character plotting function.

Other text objects and functions: Umlaut, capitalize(), caseflip(), cclass, count_chars_words(), count_chars(), count_words(), l33t_rul35, map_text_coord(), map_text_regex(), metachar, read_ascii(), text_to_chars(), text_to_sentences(), text_to_words(), transl33t()


ds4psy documentation built on May 12, 2021, 9:07 a.m.