Switch documents between two groups to maximize chi-square value
switch_docs(m, indices, max_index, max_chisq)
original dtm
documents indices orderes by first CA axis coordinates
document index where the split is maximum
maximum chi-square value
a list of two vectors indices1
and indices2
, which contain
the documents indices of each group after documents switching, and a chisq
value,
the new corresponding chi-square value after switching
Internal function, not to be used directly