qw: Split string into words, similar to qw() in Perl (corpora)
Description
This function splits one or more character strings into words. By default,
the strings are split on whitespace in order to emulate Perl's qw() (quote words) functionality.
Usage
qw(s, sep="\\s+", names=FALSE)
Value
A character vector of the resulting words. Multiple strings in s are flattened into a single vector.
If names=TRUE, the words are used both as values and as labels of the character vectors, which is convenient when iterating over it with lapply or sapply.
Arguments
s
one or more strings to be split (a character vector)
sep
PCRE regular expression on which to split (defaults to whitespace)
names
if TRUE, the resulting character vector is labelled with itself, which is convenient for lapply and similar functions