View source: R/text_util_fun.R
| text_to_chars | R Documentation |
x into its characters.text_to_chars splits a string of text x
(consisting of one or more character strings)
into a vector of its individual characters.
text_to_chars(x, rm_specials = FALSE, sep = "")
x |
A string of text (required). |
rm_specials |
Boolean: Remove special characters?
Default: |
sep |
Character to insert between the elements
of a multi-element character vector as input |
If rm_specials = TRUE,
most special (or non-word) characters are
removed. (Note that this currently works
without using regular expressions.)
text_to_chars is an inverse function of chars_to_text.
A character vector (containing individual characters).
chars_to_text for combining character vectors into text;
text_to_sentences for splitting text into a vector of sentences;
text_to_words for splitting text into a vector of words;
count_chars for counting the frequency of characters;
count_words for counting the frequency of words;
strsplit for splitting strings.
Other text objects and functions:
Umlaut,
capitalize(),
caseflip(),
cclass,
chars_to_text(),
collapse_chars(),
count_chars(),
count_chars_words(),
count_words(),
invert_rules(),
l33t_rul35,
map_text_chars(),
map_text_coord(),
map_text_regex(),
metachar,
read_ascii(),
text_to_sentences(),
text_to_words(),
transl33t(),
words_to_text()
s3 <- c("A 1st sentence.", "The 2nd sentence.",
"A 3rd --- and FINAL --- sentence.")
text_to_chars(s3)
text_to_chars(s3, sep = "\n")
text_to_chars(s3, rm_specials = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.