View source: R/text_util_fun.R
| words_to_text | R Documentation |
x into a text.words_to_text pastes or collapses
a character string x into a single text string.
words_to_text(x, collapse = " ")
x |
A string of text (required), typically a character vector. |
collapse |
A character string to separate the elements of |
words_to_text is essentially identical to
collapse_chars.
Internally, both functions are wrappers around
paste with a collapse argument.
A text (as a collapsed character vector).
text_to_words for splitting a text into its words;
text_to_sentences for splitting text into a vector of sentences;
text_to_chars for splitting text into a vector of characters;
count_words for counting the frequency of words;
collapse_chars for collapsing character vectors;
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_chars(),
text_to_sentences(),
text_to_words(),
transl33t()
s <- c("Hello world!", "A 1st sentence.", "A 2nd sentence.", "The end.")
words_to_text(s)
cat(words_to_text(s, collapse = "\n"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.