Description Usage Arguments Format Details Methods Author(s) See Also Examples
CSourceV
Sources a Corpus object from a character vector or vectors.
1 |
name |
Optional character vector indicating name for Corpus object. |
x |
Character vector or a list of character vectors containing text. |
collapse |
Logical. If true, collapse the character vectors into a single document. |
An object of class R6ClassGenerator
of length 24.
Sources a Corpus object from a character vector or vectors. Each vector element is treated as a separate document unless the collapse paramter is set to TRUE. If a list is encountered, each list element is treated as a separate document and the vectors are collapsed into a single document within the list structure.
new(x, name = NULL)
Initializes an object of the CSourceV class.
execute()
Executes the process of sourcing the Corpus object.
John James, jjames@datasciencesalon.org
Other Corpus Source Classes: CSource0
,
CSourceDir
, CSourceFileSet
,
CSourceQ
, CSourceTM
1 2 3 4 5 6 7 8 9 10 11 | text <- c("The firm possesses unparalleled leverage in Washington,
thanks in part to its track record of funneling executives into
senior government posts. Even the Trump administration, which
rode a populist wave to electoral victory, is stocked with
Goldman alumni, including Treasury Secretary Steven Mnuchin and
the departing White House economic adviser Gary D. Cohn.",
"Goldman is also an adviser to many of America’s — and the
world’s — largest companies, ranging from stalwarts like Walt
Disney to upstarts like Uber.")
corpus <- CSource$new(x = txt, name = "Goldman")$vector()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.