Computes the Deviation of Proportions (DP) measure developed by Stefan Th. Gries. DP measures how evenly distributed a term is across all parts of the corpus. The normalized version (DP_norm) is returned, which ranges from 0 (evenly distributed) to 1 (extremely clumped distribution).
calc_dp(tdm)
A numeric vector of normalized DP values for each term
A term-document matrix
Gries, S. T. (2008). Dispersions and adjusted frequencies in corpora. International Journal of Corpus Linguistics, 13(4), 403-437.