A function to generate a document term matrix from a list of document term vectors.
generate_document_term_matrix(document_term_vector_list, vocabulary = NULL,
document_term_count_list = NULL, return_sparse_matrix = FALSE)
A list of term vectors, one per document, that we wish to turn into a document term matrix.
An optional vocabulary vector which will be used to form the document term matrix. Defaults to NULL, in which case a vocabulary vector will be generated internally.
A list of vectors of word counts can optionally be provided, in which case we will aggregate over them. This can be useful if we wish to store documents in a memory efficent way. Defaults to NULL.
Defualts to FALSE, in whih case a normal dense matrix is returned. If TRUE, then a sparse matrix object generated by the slam library is returned. A sparse matrix representation is also used in the C++ code if this is set to TRUE, which can result in drastic memory savings.
A dense document term matrix object with the vocabulary as column names.