read_ascii | R Documentation |
read_ascii
parses text inputs
(from a file or from user input in the Console)
into a character vector.
read_ascii(file = "", quiet = FALSE)
file |
The text file to read (or its path).
If |
quiet |
Boolean: Provide user feedback?
Default: |
Different lines of text are represented by different elements of the character vector returned.
The getwd
function is used to determine the current
working directory. This replaces the here package,
which was previously used to determine an (absolute) file path.
Note that read_ascii
originally contained
map_text_coord
, but has been separated to
enable independent access to separate functionalities.
A character vector, with its elements denoting different lines of text.
map_text_coord
for mapping text to a table of character coordinates;
plot_chars
for a character plotting function.
Other text objects and functions:
Umlaut
,
capitalize()
,
caseflip()
,
cclass
,
chars_to_text()
,
collapse_chars()
,
count_chars_words()
,
count_chars()
,
count_words()
,
invert_rules()
,
l33t_rul35
,
map_text_chars()
,
map_text_coord()
,
map_text_regex()
,
metachar
,
text_to_chars()
,
text_to_sentences()
,
text_to_words()
,
transl33t()
,
words_to_text()
## Create a temporary file "test.txt":
# cat("Hello world!", "This is a test.",
# "Can you see this text?",
# "Good! Please carry on...",
# file = "test.txt", sep = "\n")
## (a) Read text (from file):
# read_ascii("test.txt")
# read_ascii("test.txt", quiet = TRUE) # y flipped
# unlink("test.txt") # clean up (by deleting file).
## (b) Read text (from file in subdir):
# read_ascii("data-raw/txt/ascii.txt") # requires txt file
## (c) Scan user input (from console):
# read_ascii()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.