I have several large TermDocumentMatrices, which I'm trimming down to a more manageable size using the removeSparseTerms()
function. One of the arguments I have to send this, of course, is sparse
.
Because the TDMs are all quite different, I'd like to be able to base the value I pass to sparse
on some measure of their sparsity. I can see this measure using the inspect()
function, but for the life of me I can't find a way to extract this from the metadata. Is there a suitable function in tm
that I just haven't found?