Description Usage Arguments Details Value See Also Examples
Create a vector source.
1 | VectorSource(x)
|
x |
A vector giving the texts. |
A vector source interprets each element of the vector x
as a
document.
An object inheriting from VectorSource
, SimpleSource
,
and Source
.
Source
for basic information on the source infrastructure
employed by package tm.
1 2 3 | docs <- c("This is a text.", "This another one.")
(vs <- VectorSource(docs))
inspect(VCorpus(vs))
|
Loading required package: NLP
$encoding
[1] ""
$length
[1] 2
$position
[1] 0
$reader
function (elem, language, id)
{
if (!is.null(elem$uri))
id <- basename(elem$uri)
PlainTextDocument(elem$content, id = id, language = language)
}
<environment: namespace:tm>
$content
[1] "This is a text." "This another one."
attr(,"class")
[1] "VectorSource" "SimpleSource" "Source"
<<VCorpus>>
Metadata: corpus specific: 0, document level (indexed): 0
Content: documents: 2
[[1]]
<<PlainTextDocument>>
Metadata: 7
Content: chars: 15
[[2]]
<<PlainTextDocument>>
Metadata: 7
Content: chars: 17
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.