Return the proportion of sparseness of a document-feature matrix, equal to the proportion of cells that have zero counts.
sparsity(x)
the document-feature matrix
# NOT RUN {
dfmat <- dfm(data_corpus_inaugural)
sparsity(dfmat)
sparsity(dfm_trim(dfmat, min_termfreq = 5))
# }
Run the code above in your browser using DataLab