Description Usage Arguments Value Author(s) See Also Examples
View source: R/build_structure_for_list.R
Builds a structure for a list of Corpus Objects. The structure is based on the structKey given with the default being a Term Frequency Matrix
1 | build_structure_for_list(structKey = "tf", corpusList = NULL, tokenizer)
|
structKey |
key of structure to be generated Possible Values are: "tf" for Term frequency Matrix "dtm" for DocumentTermMatrix (tm Package Object) "m" for a Matrix of terms "v" for a sorted Vector of terms "tfidf" for a term frequency inverse document frequency Matrix |
corpusList |
a List of VCorpus which generate from tm package: c(VCorpus1, ..., VCorpusN) |
tokenizer |
tokenizer based on the RWeka Package |
List of given data structure
MFinst
tm Package for VCorpus
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (structKey = "tf", corpusList = NULL, tokenizer)
{
if (is.null(corpusList)) {
print("corpus is NULL!")
return(NULL)
}
structureCount = length(corpusList)
result_structList = list()
for (i in 1:structureCount) {
struct = matrix_gen(corpus = corpusList[[i]], struct = structKey,
dtmTokenizer = tokenizer)
result_structList[[i]] = struct
print(paste(i, " struct calculated"))
}
return(result_structList)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.